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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 22 06:45:31 UTC 2009

Modified Files:
src/sys/arch/algor/include [matt-nb5-mips64]: param.h
src/sys/arch/arc/include [matt-nb5-mips64]: param.h
src/sys/arch/cobalt/include [matt-nb5-mips64]: param.h
src/sys/arch/evbmips/include [matt-nb5-mips64]: param.h
src/sys/arch/ews4800mips/include [matt-nb5-mips64]: param.h
src/sys/arch/hpcmips/include [matt-nb5-mips64]: param.h
src/sys/arch/mips/include [matt-nb5-mips64]: mips_param.h
src/sys/arch/mipsco/include [matt-nb5-mips64]: param.h
src/sys/arch/newsmips/include [matt-nb5-mips64]: param.h
src/sys/arch/playstation2/include [matt-nb5-mips64]: param.h
src/sys/arch/pmax/include [matt-nb5-mips64]: param.h
src/sys/arch/sbmips/include [matt-nb5-mips64]: param.h
src/sys/arch/sgimips/include [matt-nb5-mips64]: param.h

Log Message:
Move MACHINE_ARCH definition to mips/mips_param.h
Move mbuf related defines to mips/mips_param.h


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.78.1 src/sys/arch/algor/include/param.h
cvs rdiff -u -r1.24 -r1.24.96.1 src/sys/arch/arc/include/param.h
cvs rdiff -u -r1.14 -r1.14.74.1 src/sys/arch/cobalt/include/param.h
cvs rdiff -u -r1.5.96.1 -r1.5.96.2 src/sys/arch/evbmips/include/param.h
cvs rdiff -u -r1.1 -r1.1.98.1 src/sys/arch/ews4800mips/include/param.h
cvs rdiff -u -r1.12 -r1.12.74.1 src/sys/arch/hpcmips/include/param.h
cvs rdiff -u -r1.23.78.1 -r1.23.78.2 src/sys/arch/mips/include/mips_param.h
cvs rdiff -u -r1.9 -r1.9.38.1 src/sys/arch/mipsco/include/param.h
cvs rdiff -u -r1.16 -r1.16.38.1 src/sys/arch/newsmips/include/param.h
cvs rdiff -u -r1.5 -r1.5.74.1 src/sys/arch/playstation2/include/param.h
cvs rdiff -u -r1.38 -r1.38.76.1 src/sys/arch/pmax/include/param.h
cvs rdiff -u -r1.5 -r1.5.28.1 src/sys/arch/sbmips/include/param.h
cvs rdiff -u -r1.10 -r1.10.28.1 src/sys/arch/sgimips/include/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/algor/include/param.h
diff -u src/sys/arch/algor/include/param.h:1.7 src/sys/arch/algor/include/param.h:1.7.78.1
--- src/sys/arch/algor/include/param.h:1.7	Tue Sep  5 01:33:24 2006
+++ src/sys/arch/algor/include/param.h	Sat Aug 22 06:45:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.7 2006/09/05 01:33:24 gdamore Exp $	*/
+/*	$NetBSD: param.h,v 1.7.78.1 2009/08/22 06:45:28 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -89,8 +89,6 @@
  * Machine dependent constants for Algorithmics boards.
  */
 
-#define	_MACHINE_ARCH	mipsel
-#define	MACHINE_ARCH	mipsel
 #define	_MACHINE	algor
 #define	MACHINE		algor
 #define	MID_MACHINE	MID_PMAX	/* XXX Bogus, but needed for now... */
@@ -100,34 +98,6 @@
 #define BLKDEV_IOSIZE	2048
 #define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
 
-/*
- * 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.
- */
-#define	MSIZE		256		/* size of an mbuf */
-
-#ifndef MCLSHIFT
-#define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
-	/* 2K cluster can hold Ether frame */
-#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
-
 #ifdef _KERNEL
 #ifndef _LOCORE
 

Index: src/sys/arch/arc/include/param.h
diff -u src/sys/arch/arc/include/param.h:1.24 src/sys/arch/arc/include/param.h:1.24.96.1
--- src/sys/arch/arc/include/param.h:1.24	Sun Dec 11 12:16:39 2005
+++ src/sys/arch/arc/include/param.h	Sat Aug 22 06:45:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.24 2005/12/11 12:16:39 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.24.96.1 2009/08/22 06:45:28 matt Exp $	*/
 /*  $OpenBSD: param.h,v 1.9 1997/04/30 09:54:15 niklas Exp $ */
 
 /*
@@ -90,8 +90,6 @@
  *	Deskstation Tyne
  *	Etc
  */
-#define	_MACHINE_ARCH	mipsel
-#define	MACHINE_ARCH	mipsel
 #define	_MACHINE	arc
 #define	MACHINE		arc
 #define	MID_MACHINE	MID_PMAX	/* XXX Bogus, but needed for now... */
@@ -117,34 +115,6 @@
 #define	UVPN		(UADDRPGSHIFT)/* virtual page number of u */
 #define	KERNELSTACK	(UADDR+UPAGES*NBPG)	/* top of kernel stack */
 
-/*
- * 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.
- */
-#define	MSIZE		256		/* size of an mbuf */
-
-#ifndef 

CVS commit: src

2009-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 22 06:52:16 UTC 2009

Modified Files:
src/rescue: Makefile list.ldd
src/usr.bin/ldd: Makefile ldd.1 ldd.c ldd.h
Removed Files:
src/rescue: list.ldd.noaout
src/usr.bin/ldd: ldd_aout.c
src/usr.bin/ldd/aout: Makefile

Log Message:
kill ldd_aout.  it didn't work anyway...not since i don't know when.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/rescue/Makefile
cvs rdiff -u -r1.1 -r1.2 src/rescue/list.ldd
cvs rdiff -u -r1.1 -r0 src/rescue/list.ldd.noaout
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/ldd/Makefile
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/ldd/ldd.1
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/ldd/ldd.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/ldd/ldd.h
cvs rdiff -u -r1.4 -r0 src/usr.bin/ldd/ldd_aout.c
cvs rdiff -u -r1.1 -r0 src/usr.bin/ldd/aout/Makefile

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

Modified files:

Index: src/rescue/Makefile
diff -u src/rescue/Makefile:1.23 src/rescue/Makefile:1.24
--- src/rescue/Makefile:1.23	Fri Aug 21 15:16:45 2009
+++ src/rescue/Makefile	Sat Aug 22 06:52:15 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2009/08/21 15:16:45 he Exp $
+#	$NetBSD: Makefile,v 1.24 2009/08/22 06:52:15 mrg Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
@@ -35,13 +35,7 @@
 CRUNCHENV+=	MKKERBEROS=no		# for ssh
 .endif
 
-.if ${MACHINE_CPU} != mips
 LISTS+=		${.CURDIR}/list.ldd
-LDD_AOUTDIR!=	cd ${NETBSDSRCDIR}/usr.bin/ldd/aout  ${PRINTOBJDIR}
-PARSELISTENV+=	LDD_AOUTDIR=${LDD_AOUTDIR}
-.else
-LISTS+=		${.CURDIR}/list.ldd.noaout
-.endif
 LDD_ELF32DIR!=	cd ${NETBSDSRCDIR}/usr.bin/ldd/elf32  ${PRINTOBJDIR}
 LDD_ELF64DIR!=	cd ${NETBSDSRCDIR}/usr.bin/ldd/elf64  ${PRINTOBJDIR}
 PARSELISTENV+=	LDD_ELF32DIR=${LDD_ELF32DIR} LDD_ELF64DIR=${LDD_ELF64DIR}

Index: src/rescue/list.ldd
diff -u src/rescue/list.ldd:1.1 src/rescue/list.ldd:1.2
--- src/rescue/list.ldd:1.1	Wed Jan  7 00:39:24 2009
+++ src/rescue/list.ldd	Sat Aug 22 06:52:15 2009
@@ -1,8 +1,7 @@
-#	$NetBSD: list.ldd,v 1.1 2009/01/07 00:39:24 mrg Exp $
+#	$NetBSD: list.ldd,v 1.2 2009/08/22 06:52:15 mrg Exp $
 
 PROG	ldd
 
-LIBS	${LDD_AOUTDIR}/libldd_aout.a
 LIBS	${LDD_ELF32DIR}/libldd_elf32.a
 LIBS	${LDD_ELF64DIR}/libldd_elf64.a
 

Index: src/usr.bin/ldd/Makefile
diff -u src/usr.bin/ldd/Makefile:1.12 src/usr.bin/ldd/Makefile:1.13
--- src/usr.bin/ldd/Makefile:1.12	Thu Aug 20 21:07:47 2009
+++ src/usr.bin/ldd/Makefile	Sat Aug 22 06:52:16 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2009/08/20 21:07:47 he Exp $
+#	$NetBSD: Makefile,v 1.13 2009/08/22 06:52:16 mrg Exp $
 
 WARNS?=	3	# XXX: -Wsign-compare issues ld.elf_so source
 
@@ -9,12 +9,6 @@
 MAN=	ldd.1
 
 
-.if (${MACHINE_CPU} != mips)
-SUBDIR=		aout
-LIB_AOUTDIR!=	cd ${.CURDIR}/aout  ${PRINTOBJDIR}
-EXTRA_LIBS+=	${LIB_AOUTDIR}/libldd_aout.a
-.endif
-
 SUBDIR+= 	elf32 elf64
 
 .if (${MACHINE_ARCH} != alpha)

Index: src/usr.bin/ldd/ldd.1
diff -u src/usr.bin/ldd/ldd.1:1.14 src/usr.bin/ldd/ldd.1:1.15
--- src/usr.bin/ldd/ldd.1:1.14	Wed Apr 30 13:11:01 2008
+++ src/usr.bin/ldd/ldd.1	Sat Aug 22 06:52:16 2009
@@ -1,4 +1,4 @@
-.\	$NetBSD: ldd.1,v 1.14 2008/04/30 13:11:01 martin Exp $
+.\	$NetBSD: ldd.1,v 1.15 2009/08/22 06:52:16 mrg Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -53,26 +53,10 @@
 and allows customization of
 .Nm ldd Ns 's
 output.
-The first format argument is used for library objects and is equivalent
-to the
-.Xr ld.aout_so 1
-environment variable
-.Ev LD_TRACE_LOADED_OBJECTS_FMT1 .
-It defaults to
-.Qq \et-l%o.%m =\*[Gt] %p\en
-for elf and
-.Qq \et-l%o.%m =\*[Gt] %p (%x)\en
-for a.out.
-The second format argument is used for non-library objects and it is equivalent
-to the
-.Xr ld.aout_so 1
-environment variable
-.Ev LD_TRACE_LOADED_OBJECTS_FMT2 .
-It defaults to
-.Qq \et%o =\*[Gt] %p\en
-for elf and
-.Qq \et%o (%x)\en
-for a.out.
+The first format argument is used for library objects and defaults to
+.Qq \et-l%o.%m =\*[Gt] %p\en .
+The second format argument is used for non-library objects defaults to
+.Qq \et%o =\*[Gt] %p\en .
 .Pp
 These arguments are interpreted as format strings a la
 .Xr printf 3
@@ -111,7 +95,6 @@
 are recognized and have their usual meaning.
 .Sh SEE ALSO
 .Xr ld 1 ,
-.Xr ld.aout_so 1 ,
 .Xr ld.elf_so 1 ,
 .Xr nm 1 ,
 .Xr rtld 1

Index: src/usr.bin/ldd/ldd.c
diff -u src/usr.bin/ldd/ldd.c:1.8 src/usr.bin/ldd/ldd.c:1.9
--- src/usr.bin/ldd/ldd.c:1.8	Thu Aug 20 21:06:17 2009
+++ src/usr.bin/ldd/ldd.c	Sat Aug 22 06:52:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldd.c,v 1.8 2009/08/20 21:06:17 he Exp $	*/
+/*	$NetBSD: ldd.c,v 1.9 2009/08/22 06:52:16 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ldd.c,v 1.8 2009/08/20 21:06:17 he Exp $);
+__RCSID($NetBSD: ldd.c,v 1.9 2009/08/22 06:52:16 mrg Exp $);
 #endif 

CVS commit: src/sys/arch/mvme68k/stand/bootxx

2009-08-22 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sat Aug 22 10:02:21 UTC 2009

Modified Files:
src/sys/arch/mvme68k/stand/bootxx: bootxx.c

Log Message:
This one needs sys/exec_aout.h, so include it explicitly.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mvme68k/stand/bootxx/bootxx.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/mvme68k/stand/bootxx/bootxx.c
diff -u src/sys/arch/mvme68k/stand/bootxx/bootxx.c:1.15 src/sys/arch/mvme68k/stand/bootxx/bootxx.c:1.16
--- src/sys/arch/mvme68k/stand/bootxx/bootxx.c:1.15	Mon Apr 28 20:23:29 2008
+++ src/sys/arch/mvme68k/stand/bootxx/bootxx.c	Sat Aug 22 10:02:21 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootxx.c,v 1.15 2008/04/28 20:23:29 martin Exp $ */
+/*	$NetBSD: bootxx.c,v 1.16 2009/08/22 10:02:21 he Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -43,6 +43,7 @@
 #include sys/time.h
 #include sys/exec.h
 #include sys/exec_elf.h
+#include sys/exec_aout.h
 #include machine/prom.h
 
 #include lib/libsa/stand.h



CVS commit: src/usr.bin/sort

2009-08-22 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Sat Aug 22 10:53:28 UTC 2009

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

Log Message:
Rework the way sort generates sort keys:
- If we generate a key, it is always sortable using memcmp()
- If we are sorting the whole record, then a weight-table must be used
  during compares.
- Major surgery to encoding of numbers to ensure unique keys for equal
  numeric values.  Reverse numerics are handled by inverting the sign.
- Case folding (-f) is handled when the sort keys are generated. No other
  code has to care at all.
- Key uniqueness (-u) is done during merge for large datasets. It only
  has to be done when writing the output file for small files.
  Since the file is in key order this is simple!
Probably fixes all of: PR/27257 PR/25551 PR/22182 PR/31095 PR/30504
PR/36816 PR/37860 PR/39308
Also PR/18614 should no longer die, but a little more work needs to be
done on the merging for very large files.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/sort/append.c src/usr.bin/sort/init.c
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/sort/fields.c src/usr.bin/sort/sort.h
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/sort/files.c
cvs rdiff -u -r1.38 -r1.39 src/usr.bin/sort/fsort.c
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/sort/msort.c
cvs rdiff -u -r1.51 -r1.52 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.19 src/usr.bin/sort/append.c:1.20
--- src/usr.bin/sort/append.c:1.19	Thu Aug 20 06:36:25 2009
+++ src/usr.bin/sort/append.c	Sat Aug 22 10:53:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: append.c,v 1.19 2009/08/20 06:36:25 dsl Exp $	*/
+/*	$NetBSD: append.c,v 1.20 2009/08/22 10:53:28 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -64,118 +64,82 @@
 #include sort.h
 
 #ifndef lint
-__RCSID($NetBSD: append.c,v 1.19 2009/08/20 06:36:25 dsl Exp $);
+__RCSID($NetBSD: append.c,v 1.20 2009/08/22 10:53:28 dsl Exp $);
 __SCCSID(@(#)append.c	8.1 (Berkeley) 6/6/93);
 #endif /* not lint */
 
 #include stdlib.h
 #include string.h
 
-#define OUTPUT {			\
-	if ((n = cpos - ppos)  1) {	\
-		ppos -= n;		\
-		radix_sort(ppos, n, wts1, REC_D);			\
-		for (; ppos  cpos; ppos++) {\
-			prec = (const RECHEADER *) (*ppos - REC_DATA_OFFSET);\
-			put(prec, fp);	\
-		}			\
-	} else put(prec, fp);		\
+static int
+wt_cmp(const u_char *a, const u_char *b, size_t len, u_char *wts)
+{
+size_t i;
+
+for (i = 0; i  len; i++) {
+	if (wts[*a++] != wts[*b++])
+		return 1;
+}
+
+return 0;
 }
 
 /*
  * copy sorted lines to output; check for uniqueness
  */
 void
-append(const u_char **keylist, int nelem, FILE *fp, put_func_t put,
-struct field *ftbl)
+append(const u_char **keylist, int nelem, FILE *fp, put_func_t put, u_char *wts)
 {
-	u_char *wts, *wts1;
-	int n;
-	const u_char **cpos, **ppos, **lastkey;
-	const u_char *cend, *pend, *start;
+	const u_char **cpos, **lastkey;
 	const struct recheader *crec, *prec;
+	size_t plen;
 
-	if (*keylist == '\0'  UNIQUE)
+	lastkey = keylist + nelem;
+	if (!UNIQUE || wts == NULL) {
+		for (cpos = keylist; cpos  lastkey; cpos++)
+			put((const RECHEADER *)(*cpos - REC_DATA_OFFSET), fp);
 		return;
-
-	wts1 = wts = ftbl[0].weights;
-	if ((!UNIQUE)  SINGL_FLD  ftbl[0].flags  F) {
-		/* Folding case */
-		if (ftbl[0].flags  R)
-			wts1 = Rascii;
-		else
-			wts1 = ascii;
 	}
 
-	lastkey = keylist + nelem;
-	if (SINGL_FLD  (UNIQUE || wts1 != wts)) {
-		ppos = keylist;
-		prec = (const RECHEADER *) (*ppos - REC_DATA_OFFSET);
-		if (UNIQUE)
-			put(prec, fp);
+	if (nelem == 0)
+		return;
+
+	cpos = keylist;
+	prec = (const RECHEADER *) (*cpos - REC_DATA_OFFSET);
+
+	if (!SINGL_FLD) {
+		/* Key for each line is already in adjacent bytes */
+		plen = prec-offset;
 		for (cpos = keylist[1]; cpos  lastkey; cpos++) {
 			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.
- */
-pend = (const u_char *) prec-data + prec-length - 2;
-cend = (const u_char *) crec-data + crec-length - 2;
-for (start = *cpos; cend = start; cend--) {
-	if (wts[*cend] != wts[*pend])
-		break;
-	pend--;
-}
-if (pend + 1 != *ppos) {
-	if (!UNIQUE) {
-		OUTPUT;
-	} else
-		put(crec, fp);
-	ppos = cpos;
-	prec = crec;
-}
-			} else {
-if (!UNIQUE) {
-	OUTPUT;
-} else
-	put(crec, fp);
-ppos = cpos;
-prec = crec;
+			if (crec-offset == plen
+			 memcmp(crec-data, prec-data, plen) == 0) {
+/* Duplicate key */
+continue;
 			}
+			put(prec, fp);
+			prec = crec;
+			plen = prec-offset;
 		}
-		if (!UNIQUE)  { OUTPUT; }
-	} else if 

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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 22 16:55:19 UTC 2009

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

Log Message:
Use sy_narg, not sy_argsize!
Add debug code to pretty print args.


To generate a diff of this commit:
cvs rdiff -u -r1.37.12.3 -r1.37.12.4 src/sys/arch/mips/mips/syscall.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/syscall.c
diff -u src/sys/arch/mips/mips/syscall.c:1.37.12.3 src/sys/arch/mips/mips/syscall.c:1.37.12.4
--- src/sys/arch/mips/mips/syscall.c:1.37.12.3	Sat Aug 22 00:28:42 2009
+++ src/sys/arch/mips/mips/syscall.c	Sat Aug 22 16:55:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.37.12.3 2009/08/22 00:28:42 matt Exp $	*/
+/*	$NetBSD: syscall.c,v 1.37.12.4 2009/08/22 16:55:19 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.37.12.3 2009/08/22 00:28:42 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: syscall.c,v 1.37.12.4 2009/08/22 16:55:19 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_sa.h
@@ -227,13 +227,12 @@
 	else
 		callp += code;
 
-	nargs = callp-sy_argsize;
+	nargs = callp-sy_narg;
 	frame-f_regs[_R_V0] = 0;
 #if !defined(__mips_o32)
 	if (abi != _MIPS_BSD_API_O32) {
 #endif
 		CTASSERT(sizeof(copyargs[0]) == sizeof(fargs[0]));
-		/* rval[1] already is V1 */
 		if (nargs = nregs) {
 			/*
 			 * Just use the frame for the source of arguments
@@ -241,6 +240,7 @@
 			args = fargs;
 		} else {
 			const size_t nsaved = _MIPS_SIM_NEWABI_P(abi) ? 0 : 4;
+			KASSERT(nargs = __arraycount(copyargs));
 			args = copyargs;
 			/*
 			 * Copy the arguments passed via register from the * trap frame to our argument array
@@ -352,6 +352,22 @@
 	} while (/*CONSTCOND*/ 0);	/* avoid a goto */
 #endif
 
+#if 0
+	if (p-p_emul-e_syscallnames)
+		printf(syscall %s:, p-p_emul-e_syscallnames[code]);
+	else
+		printf(syscall %u:, code);
+	if (nargs == 0)
+		printf( no args);
+	else for (size_t j = 0; j  nargs; j++) {
+		if (j == nregs) printf( *);
+		printf( [%s%zu]=%#PRIxREGISTER,
+		SYCALL_ARG_64_P(callp, j) ? + : ,
+		j, args[j]);
+	}
+	printf(\n);
+#endif
+
 	if (__predict_false(p-p_trace_enabled)
 	 (error = trace_enter(code, args, nargs)) != 0)
 		goto out;



CVS commit: src/usr.bin/unzip

2009-08-22 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Aug 22 17:19:11 UTC 2009

Modified Files:
src/usr.bin/unzip: unzip.1 unzip.c

Log Message:
Add support for -c, make the output of -l/-v more similar to infozip.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/unzip/unzip.1
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/unzip/unzip.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/unzip/unzip.1
diff -u src/usr.bin/unzip/unzip.1:1.3 src/usr.bin/unzip/unzip.1:1.4
--- src/usr.bin/unzip/unzip.1:1.3	Sat Aug 22 02:19:42 2009
+++ src/usr.bin/unzip/unzip.1	Sat Aug 22 17:19:11 2009
@@ -25,7 +25,7 @@
 .\ SUCH DAMAGE.
 .\
 .\ $FreeBSD: revision 180125$
-.\ $NetBSD: unzip.1,v 1.3 2009/08/22 02:19:42 joerg Exp $
+.\ $NetBSD: unzip.1,v 1.4 2009/08/22 17:19:11 joerg Exp $
 .\
 .Dd August 22, 2009
 .Dt UNZIP 1
@@ -45,6 +45,12 @@
 .It Fl a
 When extracting a text file, convert DOS-style line endings to
 Unix-style line endings.
+.It Fl c
+Extract to stdout/screen.
+When extracting files from the zipfile, they are written to stdout.
+This is similar to
+.Fl p ,
+but doesn't suppress normal output.
 .It Fl d Ar dir
 Extract files into the specified directory rather than the current
 directory.

Index: src/usr.bin/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.2 src/usr.bin/unzip/unzip.c:1.3
--- src/usr.bin/unzip/unzip.c:1.2	Sat Aug 22 02:19:42 2009
+++ src/usr.bin/unzip/unzip.c	Sat Aug 22 17:19:11 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.2 2009/08/22 02:19:42 joerg Exp $ */
+/* $NetBSD: unzip.c,v 1.3 2009/08/22 17:19:11 joerg Exp $ */
 
 /*-
  * Copyright (c) 2009 Joerg Sonnenberger jo...@netbsd.org
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: unzip.c,v 1.2 2009/08/22 02:19:42 joerg Exp $);
+__RCSID($NetBSD: unzip.c,v 1.3 2009/08/22 17:19:11 joerg Exp $);
 
 #include sys/queue.h
 #include sys/stat.h
@@ -57,17 +57,18 @@
 
 /* command-line options */
 static int		 a_opt;		/* convert EOL */
+static int		 c_opt;		/* extract to stoud */
 static const char	*d_arg;		/* directory */
 static int		 f_opt;		/* update existing files only */
 static int		 j_opt;		/* junk directories */
 static int		 L_opt;		/* lowercase names */
 static int		 n_opt;		/* never overwrite */
 static int		 o_opt;		/* always overwrite */
-static int		 p_opt;		/* extract to stdout */
+static int		 p_opt;		/* extract to stdout, quiet */
 static int		 q_opt;		/* quiet */
 static int		 t_opt;		/* test */
 static int		 u_opt;		/* update */
-static int		 v_opt;		/* verbose */
+static int		 v_opt;		/* verbose/list */
 
 /* time when unzip started */
 static time_t		 now;
@@ -666,6 +667,9 @@
 		return;
 	}
 
+	if (c_opt)
+		info(x %s\n, pathname);
+
 	text = a_opt;
 	warn = 0;
 	cr = 0;
@@ -677,9 +681,10 @@
 
 		/* left over CR from previous buffer */
 		if (a_opt  cr) {
-			if (len == 0 || buffer[0] != '\n')
-if (write(STDOUT_FILENO, \r, 1) != 1)
+			if (len == 0 || buffer[0] != '\n') {
+if (fwrite(\r, 1, 1, stderr) != 1)
 	error(write('%s'), pathname);
+			}
 			cr = 0;
 		}
 
@@ -709,7 +714,7 @@
 
 		/* simple case */
 		if (!a_opt || !text) {
-			if (write(STDOUT_FILENO, buffer, len) != len)
+			if (fwrite(buffer, 1, len, stdout) != (size_t)len)
 error(write('%s'), pathname);
 			continue;
 		}
@@ -732,7 +737,7 @@
 if (q[1] == '\n')
 	break;
 			}
-			if (write(STDOUT_FILENO, p, q - p) != q - p)
+			if (fwrite(p, 1, q - p, stdout) != (size_t)(q - p))
 error(write('%s'), pathname);
 		}
 	}
@@ -746,27 +751,23 @@
 static void
 list(struct archive *a, struct archive_entry *e)
 {
-	static int printed_header;
 	char buf[20];
 	time_t mtime;
 
-	if (!printed_header  !q_opt) {
-		printed_header = 1;
-		printf( Length   MethodSize  Ratio   Date   Time  CRC-32Name\n);
-		printf(  --  --- -        --\n);
-	}
+	mtime = archive_entry_mtime(e);
+	strftime(buf, sizeof(buf), %m-%d-%g %R, localtime(mtime));
 
-	if (v_opt == 2) {
-		mtime = archive_entry_mtime(e);
-		strftime(buf, sizeof(buf), %m-%d-%g %R, localtime(mtime));
+	if (v_opt == 1) {
+		printf( %8ju  %s   %s\n,
+		(uintmax_t)archive_entry_size(e),
+		buf, archive_entry_pathname(e));
+	} else if (v_opt == 2) {
 		printf(%8ju  Stored  %7ju   0%%  %s %08x  %s\n,
 		(uintmax_t)archive_entry_size(e),
 		(uintmax_t)archive_entry_size(e),
 		buf,
 		0U,
 		archive_entry_pathname(e));
-	} else {
-		printf(%s\n, archive_entry_pathname(e));
 	}
 	ac(archive_read_data_skip(a));
 }
@@ -807,6 +808,7 @@
 	struct archive *a;
 	struct archive_entry *e;
 	int fd, ret;
+	uintmax_t total_size, file_count;
 
 	if ((fd = open(fn, O_RDONLY))  0)
 		error(%s, fn);
@@ -815,6 +817,16 @@
 	ac(archive_read_support_format_zip(a));
 	ac(archive_read_open_fd(a, fd, 8192));
 
+	if (v_opt == 1) {
+		printf(  Length Date   Time   Name\n);
+		printf(       \n);

CVS commit: src/sys/dev/tc

2009-08-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Aug 22 17:36:13 UTC 2009

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

Log Message:
MALLOC() - malloc()


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/tc/sfbplus.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/sfbplus.c
diff -u src/sys/dev/tc/sfbplus.c:1.31 src/sys/dev/tc/sfbplus.c:1.32
--- src/sys/dev/tc/sfbplus.c:1.31	Wed Jul  9 13:19:33 2008
+++ src/sys/dev/tc/sfbplus.c	Sat Aug 22 17:36:12 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: sfbplus.c,v 1.31 2008/07/09 13:19:33 joerg Exp $ */
+/* $NetBSD: sfbplus.c,v 1.32 2009/08/22 17:36:12 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sfbplus.c,v 1.31 2008/07/09 13:19:33 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: sfbplus.c,v 1.32 2009/08/22 17:36:12 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -263,8 +263,7 @@
 		sc-nscreens = 1;
 	}
 	else {
-		MALLOC(ri, struct rasops_info *, sizeof(struct rasops_info),
-			M_DEVBUF, M_NOWAIT);
+		ri = malloc(sizeof(struct rasops_info), M_DEVBUF, M_NOWAIT);
 		if (ri == NULL) {
 			printf(: can't alloc memory\n);
 			return;



CVS commit: src/usr.bin/sort

2009-08-22 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Sat Aug 22 21:19:41 UTC 2009

Modified Files:
src/usr.bin/sort: fields.c

Log Message:
Only process each number digit once.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.bin/sort/fields.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/fields.c
diff -u src/usr.bin/sort/fields.c:1.25 src/usr.bin/sort/fields.c:1.26
--- src/usr.bin/sort/fields.c:1.25	Sat Aug 22 10:53:28 2009
+++ src/usr.bin/sort/fields.c	Sat Aug 22 21:19:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fields.c,v 1.25 2009/08/22 10:53:28 dsl Exp $	*/
+/*	$NetBSD: fields.c,v 1.26 2009/08/22 21:19:40 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.25 2009/08/22 10:53:28 dsl Exp $);
+__RCSID($NetBSD: fields.c,v 1.26 2009/08/22 21:19:40 dsl Exp $);
 __SCCSID(@(#)fields.c	8.1 (Berkeley) 6/6/93);
 #endif /* not lint */
 
@@ -335,7 +335,7 @@
 	for (last_nz_pos = pos; line  lineend; ) {
 		if (pos = bufend)
 			return NULL;
-		ch = *line;
+		ch = *line++;
 		val = (ch - '0') * 10;
 		if (val  90) {
 			if (ch == DECIMAL_POINT  !had_dp) {



CVS commit: src/usr.bin/sort

2009-08-22 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Sat Aug 22 21:28:55 UTC 2009

Modified Files:
src/usr.bin/sort: fields.c

Log Message:
Fix generation of unmasked alpha keys.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/sort/fields.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/fields.c
diff -u src/usr.bin/sort/fields.c:1.26 src/usr.bin/sort/fields.c:1.27
--- src/usr.bin/sort/fields.c:1.26	Sat Aug 22 21:19:40 2009
+++ src/usr.bin/sort/fields.c	Sat Aug 22 21:28:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fields.c,v 1.26 2009/08/22 21:19:40 dsl Exp $	*/
+/*	$NetBSD: fields.c,v 1.27 2009/08/22 21:28:55 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.26 2009/08/22 21:19:40 dsl Exp $);
+__RCSID($NetBSD: fields.c,v 1.27 2009/08/22 21:28:55 dsl Exp $);
 __SCCSID(@(#)fields.c	8.1 (Berkeley) 6/6/93);
 #endif /* not lint */
 
@@ -205,7 +205,7 @@
 	mask = cur_fld-mask;
 	lweight = cur_fld-weights;	
 	for (; start  end; start++) {
-		if (mask  mask[*start]) {
+		if (!mask || mask[*start]) {
 			*tablepos++ = lweight[*start];
 		}
 	}



CVS commit: src/usr.bin/sort

2009-08-22 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Sat Aug 22 21:43:53 UTC 2009

Modified Files:
src/usr.bin/sort: sort.c

Log Message:
Put radixsort() and sradixsort() the correct way around.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 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/sort.c
diff -u src/usr.bin/sort/sort.c:1.52 src/usr.bin/sort/sort.c:1.53
--- src/usr.bin/sort/sort.c:1.52	Sat Aug 22 10:53:28 2009
+++ src/usr.bin/sort/sort.c	Sat Aug 22 21:43:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: sort.c,v 1.52 2009/08/22 10:53:28 dsl Exp $	*/
+/*	$NetBSD: sort.c,v 1.53 2009/08/22 21:43:53 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
 #endif /* not lint */
 
 #ifndef lint
-__RCSID($NetBSD: sort.c,v 1.52 2009/08/22 10:53:28 dsl Exp $);
+__RCSID($NetBSD: sort.c,v 1.53 2009/08/22 21:43:53 dsl Exp $);
 __SCCSID(@(#)sort.c	8.1 (Berkeley) 6/6/93);
 #endif /* not lint */
 
@@ -196,10 +196,10 @@
 			break;
 		case 's':
 			/* for GNU sort compatibility (this is our default) */
-			radix_sort = radixsort;
+			radix_sort = sradixsort;
 			break;
 		case 'S':
-			radix_sort = sradixsort;
+			radix_sort = radixsort;
 			break;
 		case 't':
 			if (SEP_FLAG)



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

2009-08-22 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sat Aug 22 23:08:01 UTC 2009

Modified Files:
src/sys/arch/pmax/include: loadfile_machdep.h

Log Message:
Remove BOOT_AOUT, since our mips ports no longer deal with a.out.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/pmax/include/loadfile_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/pmax/include/loadfile_machdep.h
diff -u src/sys/arch/pmax/include/loadfile_machdep.h:1.6 src/sys/arch/pmax/include/loadfile_machdep.h:1.7
--- src/sys/arch/pmax/include/loadfile_machdep.h:1.6	Mon Apr 28 20:23:31 2008
+++ src/sys/arch/pmax/include/loadfile_machdep.h	Sat Aug 22 23:08:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: loadfile_machdep.h,v 1.6 2008/04/28 20:23:31 martin Exp $	 */
+/*	$NetBSD: loadfile_machdep.h,v 1.7 2009/08/22 23:08:01 he Exp $	 */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,6 @@
 #ifndef _PMAX_LOADFILE_MACHDEP_H_
 #define _PMAX_LOADFILE_MACHDEP_H_
 
-#define BOOT_AOUT
 #define BOOT_ECOFF
 #define BOOT_ELF32
 



CVS commit: src/sys/compat/ossaudio

2009-08-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 22 23:31:16 UTC 2009

Modified Files:
src/sys/compat/ossaudio: ossaudio.c

Log Message:
add a lot more debugging and error checking. Alas, skype seems to be happy
getting back our values, but still does not work.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/ossaudio/ossaudio.c

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

Modified files:

Index: src/sys/compat/ossaudio/ossaudio.c
diff -u src/sys/compat/ossaudio/ossaudio.c:1.64 src/sys/compat/ossaudio/ossaudio.c:1.65
--- src/sys/compat/ossaudio/ossaudio.c:1.64	Thu Nov 13 05:05:52 2008
+++ src/sys/compat/ossaudio/ossaudio.c	Sat Aug 22 19:31:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.64 2008/11/13 10:05:52 ad Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.65 2009/08/22 23:31:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ossaudio.c,v 1.64 2008/11/13 10:05:52 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: ossaudio.c,v 1.65 2009/08/22 23:31:16 christos Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -66,6 +66,88 @@
 
 static void setblocksize(file_t *, struct audio_info *);
 
+#ifdef AUDIO_DEBUG
+static const char *
+compat_ossaudio_getcmd(u_long cmd)
+{
+	static char buf[64];
+	switch (cmd) {
+#define _DO(_a) \
+	case _a: \
+		return # _a;
+_DO(OSS_SNDCTL_DSP_RESET)
+_DO(OSS_SNDCTL_DSP_SYNC)
+_DO(OSS_SNDCTL_DSP_SPEED)
+_DO(OSS_SOUND_PCM_READ_RATE)
+_DO(OSS_SNDCTL_DSP_STEREO)
+_DO(OSS_SNDCTL_DSP_GETBLKSIZE)
+_DO(OSS_SNDCTL_DSP_SETFMT)
+_DO(OSS_SOUND_PCM_READ_BITS)
+_DO(OSS_SNDCTL_DSP_CHANNELS)
+_DO(OSS_SOUND_PCM_READ_CHANNELS)
+_DO(OSS_SOUND_PCM_WRITE_FILTER)
+_DO(OSS_SOUND_PCM_READ_FILTER)
+_DO(OSS_SNDCTL_DSP_POST)
+_DO(OSS_SNDCTL_DSP_SUBDIVIDE)
+_DO(OSS_SNDCTL_DSP_SETFRAGMENT)
+_DO(OSS_SNDCTL_DSP_GETFMTS)
+_DO(OSS_SNDCTL_DSP_GETOSPACE)
+_DO(OSS_SNDCTL_DSP_GETISPACE)
+_DO(OSS_SNDCTL_DSP_NONBLOCK)
+_DO(OSS_SNDCTL_DSP_GETCAPS)
+_DO(OSS_SNDCTL_DSP_GETTRIGGER)
+_DO(OSS_SNDCTL_DSP_SETTRIGGER)
+_DO(OSS_SNDCTL_DSP_GETIPTR)
+_DO(OSS_SNDCTL_DSP_GETOPTR)
+_DO(OSS_SNDCTL_DSP_MAPINBUF)
+_DO(OSS_SNDCTL_DSP_MAPOUTBUF)
+_DO(OSS_SNDCTL_DSP_SETSYNCRO)
+_DO(OSS_SNDCTL_DSP_SETDUPLEX)
+_DO(OSS_SNDCTL_DSP_GETODELAY)
+_DO(OSS_SNDCTL_DSP_PROFILE)
+_DO(OSS_SOUND_MIXER_INFO)
+_DO(OSS_SOUND_OLD_MIXER_INFO)
+_DO(OSS_GET_VERSION)
+_DO(OSS_SEQ_RESET)
+_DO(OSS_SEQ_SYNC)
+_DO(OSS_SYNTH_INFO)
+_DO(OSS_SEQ_CTRLRATE)
+_DO(OSS_SEQ_GETOUTCOUNT)
+_DO(OSS_SEQ_GETINCOUNT)
+_DO(OSS_SEQ_PERCMODE)
+_DO(OSS_SEQ_TESTMIDI)
+_DO(OSS_SEQ_RESETSAMPLES)
+_DO(OSS_SEQ_NRSYNTHS)
+_DO(OSS_SEQ_NRMIDIS)
+#ifdef notyet
+_DO(OSS_MIDI_INFO)
+#endif
+_DO(OSS_SEQ_THRESHOLD)
+_DO(OSS_MEMAVL)
+_DO(OSS_FM_4OP_ENABLE)
+_DO(OSS_SEQ_PANIC)
+_DO(OSS_SEQ_OUTOFBAND)
+_DO(OSS_SEQ_GETTIME)
+_DO(OSS_ID)
+_DO(OSS_CONTROL)
+_DO(OSS_REMOVESAMPLE)
+_DO(OSS_TMR_TIMEBASE)
+_DO(OSS_TMR_START)
+_DO(OSS_TMR_STOP)
+_DO(OSS_TMR_CONTINUE)
+_DO(OSS_TMR_TEMPO)
+_DO(OSS_TMR_SOURCE)
+_DO(OSS_TMR_METRONOME)
+_DO(OSS_TMR_SELECT)
+#undef _DO
+	default:
+		(void)snprintf(buf, sizeof(buf), *0x%lx*, cmd);
+		return buf;
+	}
+}
+#endif
+
+
 static int
 compat_ossaudio_modcmd(modcmd_t cmd, void *arg)
 {
@@ -108,7 +190,7 @@
 	}
 
 	com = SCARG(uap, com);
-	DPRINTF((oss_ioctl_audio: com=%08lx\n, com));
+	DPRINTF((%s: com=%s\n, __func__, compat_ossaudio_getcmd(com)));
 
 	retval[0] = 0;
 
@@ -116,13 +198,17 @@
 	switch (com) {
 	case OSS_SNDCTL_DSP_RESET:
 		error = ioctlf(fp, AUDIO_FLUSH, NULL);
-		if (error)
+		if (error) {
+			DPRINTF((%s: AUDIO_FLUSH %d\n, __func__, error));
 			goto out;
+		}
 		break;
 	case OSS_SNDCTL_DSP_SYNC:
 		error = ioctlf(fp, AUDIO_DRAIN, NULL);
-		if (error)
+		if (error) {
+			DPRINTF((%s: AUDIO_DRAIN %d\n, __func__, error));
 			goto out;
+		}
 		break;
 	case OSS_SNDCTL_DSP_POST:
 		/* This call is merely advisory, and may be a nop. */
@@ -130,56 +216,93 @@
 	case OSS_SNDCTL_DSP_SPEED:
 		AUDIO_INITINFO(tmpinfo);
 		error = copyin(SCARG(uap, data), idat, sizeof idat);
-		if (error)
+		if (error) {
+			DPRINTF((%s: SNDCTL_DSP_SPEED %d\n,
+			 __func__, error));
 			goto out;
+		}
 		tmpinfo.play.sample_rate =
 		tmpinfo.record.sample_rate = idat;
+		DPRINTF((%s: SNDCTL_DSP_SPEED  %d\n, __func__, idat));
 		error = ioctlf(fp, AUDIO_SETINFO, tmpinfo);
-		DPRINTF((oss_sys_ioctl: SNDCTL_DSP_SPEED %d = %d\n,
-			 idat, error));
-		if (error)
+		if (error) {
+			DPRINTF((%s: SNDCTL_DSP_SPEED %d = %d\n,
+			 __func__, idat, error));
 			goto out;
+		}
 		/* fall into ... */
 	case OSS_SOUND_PCM_READ_RATE:
 		error = ioctlf(fp, AUDIO_GETBUFINFO, tmpinfo);
-		if (error)
+		if (error) {
+			DPRINTF((%s: AUDIO_GETBUFINFO %d\n,
+			 __func__, error));
 			goto out;
+		}
 		idat = tmpinfo.play.sample_rate;
+		DPRINTF((%s: SNDCTL_PCM_READ_RATE  %d\n, __func__, idat));
 		error = copyout(idat, SCARG(uap, data), sizeof idat);
-		if (error)
+		if 

CVS commit: src/sys/arch/atari

2009-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 23 01:27:13 UTC 2009

Modified Files:
src/sys/arch/atari/atari: atari_init.c
src/sys/arch/atari/include: iomap.h
src/sys/arch/atari/isa: isa_machdep.c

Log Message:
fix atari builds in two ways:
- isa_detach_hook() was missing a parameter name (hi dyoung!)
- PCI_CONF_SIZE - PCI_CONFIG_SIZE; pcivar.h has a PCI_CONF_SIZE now (hi jak!)


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/atari/atari/atari_init.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/atari/include/iomap.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/atari/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/atari/atari/atari_init.c
diff -u src/sys/arch/atari/atari/atari_init.c:1.85 src/sys/arch/atari/atari/atari_init.c:1.86
--- src/sys/arch/atari/atari/atari_init.c:1.85	Sat Aug 22 18:26:42 2009
+++ src/sys/arch/atari/atari/atari_init.c	Sun Aug 23 01:27:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: atari_init.c,v 1.85 2009/08/22 18:26:42 tsutsui Exp $	*/
+/*	$NetBSD: atari_init.c,v 1.86 2009/08/23 01:27:13 mrg Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atari_init.c,v 1.85 2009/08/22 18:26:42 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: atari_init.c,v 1.86 2009/08/23 01:27:13 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_mbtype.h
@@ -324,7 +324,7 @@
 	 * If present, add pci areas
 	 */
 	if (machineid  ATARI_HADES)
-		ptextra += btoc(PCI_CONF_SIZE + PCI_IO_SIZE + PCI_MEM_SIZE);
+		ptextra += btoc(PCI_CONFIG_SIZE + PCI_IO_SIZE + PCI_MEM_SIZE);
 	if (machineid  ATARI_MILAN)
 		ptextra += btoc(PCI_IO_SIZE + PCI_MEM_SIZE);
 	ptextra += btoc(BOOTM_VA_POOL);
@@ -776,9 +776,9 @@
 		 * Only Hades maps the PCI-config space!
 		 */
 		pci_conf_addr = ioaddr;
-		ioaddr   += PCI_CONF_SIZE;
+		ioaddr   += PCI_CONFIG_SIZE;
 		pg= pt[pci_conf_addr / PAGE_SIZE];
-		epg   = pg[btoc(PCI_CONF_SIZE)];
+		epg   = pg[btoc(PCI_CONFIG_SIZE)];
 		mask  = PCI_CONFM_PHYS;
 		pg_proto  = PCI_CONFB_PHYS | PG_RW | PG_CI | PG_V;
 		for (; pg  epg; mask = 1)

Index: src/sys/arch/atari/include/iomap.h
diff -u src/sys/arch/atari/include/iomap.h:1.12 src/sys/arch/atari/include/iomap.h:1.13
--- src/sys/arch/atari/include/iomap.h:1.12	Wed Apr  2 07:35:55 2003
+++ src/sys/arch/atari/include/iomap.h	Sun Aug 23 01:27:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: iomap.h,v 1.12 2003/04/02 07:35:55 thorpej Exp $	*/
+/*	$NetBSD: iomap.h,v 1.13 2009/08/23 01:27:12 mrg Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -81,9 +81,9 @@
 /*
  * Pre-allocated PCI-memory regions (atari_init.c). We need those in the
  * boot-stages.
- * XXX: Can probably be reduced to only PCI_CONF_SIZE (Leo).
+ * XXX: Can probably be reduced to only PCI_CONFIG_SIZE (Leo).
  */
-#define PCI_CONF_SIZE	(4 * PAGE_SIZE)
+#define PCI_CONFIG_SIZE	(4 * PAGE_SIZE)
 #define PCI_IO_SIZE	(PAGE_SIZE)
 #define PCI_MEM_SIZE	(PAGE_SIZE)
 

Index: src/sys/arch/atari/isa/isa_machdep.c
diff -u src/sys/arch/atari/isa/isa_machdep.c:1.35 src/sys/arch/atari/isa/isa_machdep.c:1.36
--- src/sys/arch/atari/isa/isa_machdep.c:1.35	Wed Aug 19 15:15:21 2009
+++ src/sys/arch/atari/isa/isa_machdep.c	Sun Aug 23 01:27:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.35 2009/08/19 15:15:21 dyoung Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.36 2009/08/23 01:27:13 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997 Leo Weppelman.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: isa_machdep.c,v 1.35 2009/08/19 15:15:21 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: isa_machdep.c,v 1.36 2009/08/23 01:27:13 mrg Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -155,7 +155,7 @@
 }
 
 void
-isa_detach_hook(isa_chipset_tag_t, device_t self)
+isa_detach_hook(isa_chipset_tag_t ic, device_t self)
 {
 }
 



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:24:09 UTC 2009

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

Log Message:
Only print the ABI when it changes.


To generate a diff of this commit:
cvs rdiff -u -r1.50.54.1.4.2 -r1.50.54.1.4.3 \
src/sys/arch/mips/mips/cpu_exec.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/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.2 src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.3
--- src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.2	Fri Aug 21 17:38:23 2009
+++ src/sys/arch/mips/mips/cpu_exec.c	Sun Aug 23 03:24:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.2 2009/08/21 17:38:23 matt Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.50.54.1.4.3 2009/08/23 03:24:08 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.4.2 2009/08/21 17:38:23 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.3 2009/08/23 03:24:08 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_compat_ultrix.h
@@ -316,6 +316,7 @@
 {
 	struct proc * const p = l-l_proc;
 	const Elf32_Ehdr * const eh = eh0;
+	int old_abi = p-p_md.md_abi;
 
 	/*
 	 * Verify we can support the architecture.
@@ -350,12 +351,14 @@
 #if !defined(__mips_o32)
 	case EF_MIPS_ABI2:
 		p-p_md.md_abi = _MIPS_BSD_API_N32;
-		printf(pid %d(%p): ABI set to N32 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
+		if (old_abi != p-p_md.md_abi)
+			printf(pid %d(%p): ABI set to N32 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
 		return 0;
 #endif
 	case EF_MIPS_ABI_O32:
 		p-p_md.md_abi = _MIPS_BSD_API_O32;
-		printf(pid %d(%p): ABI set to O32 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
+		if (old_abi != p-p_md.md_abi)
+			printf(pid %d(%p): ABI set to O32 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
 		return 0;
 	default:
 		return ENOEXEC;
@@ -405,6 +408,7 @@
 {
 	struct proc * const p = l-l_proc;
 	const Elf64_Ehdr * const eh = eh0;
+	int old_abi = p-p_md.md_abi;
 
 	switch (eh-e_flags  EF_MIPS_ARCH) {
 	case EF_MIPS_ARCH_1:
@@ -436,11 +440,13 @@
 	switch (eh-e_flags  EF_MIPS_ARCH) {
 	case 0:
 		p-p_md.md_abi = _MIPS_BSD_API_N64;
-		printf(pid %d(%p): ABI set to N64 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
+		if (old_abi != p-p_md.md_abi)
+			printf(pid %d(%p): ABI set to N64 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
 		return 0;
 	case EF_MIPS_ABI_O64:
 		p-p_md.md_abi = _MIPS_BSD_API_O64;
-		printf(pid %d(%p): ABI set to O64 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
+		if (old_abi != p-p_md.md_abi)
+			printf(pid %d(%p): ABI set to O64 (e_flags=%#x)\n, p-p_pid, p, eh-e_flags);
 		return 0;
 	default:
 		return ENOEXEC;



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:25:10 UTC 2009

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

Log Message:
taken curlwp == NULL check.


To generate a diff of this commit:
cvs rdiff -u -r1.64.16.1 -r1.64.16.2 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/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.64.16.1 src/sys/arch/mips/mips/db_interface.c:1.64.16.2
--- src/sys/arch/mips/mips/db_interface.c:1.64.16.1	Thu Aug 20 21:49:24 2009
+++ src/sys/arch/mips/mips/db_interface.c	Sun Aug 23 03:25:09 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.64.16.1 2009/08/20 21:49:24 matt Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.64.16.2 2009/08/23 03:25:09 matt Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.1 2009/08/20 21:49:24 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.2 2009/08/23 03:25:09 matt Exp $);
 
 #include opt_cputype.h	/* which mips CPUs do we support? */
 #include opt_ddb.h
@@ -715,7 +715,7 @@
 	vaddr_t ra;
 	unsigned fpucsr;
 
-	fpucsr = curlwp ? PCB_FSR(curlwp-l_addr-u_pcb) : 0;
+	fpucsr = PCB_FSR(curlwp-l_addr-u_pcb);
 	ra = MachEmulateBranch((struct frame *)regs, pc, fpucsr, 0);
 	return ra;
 }



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:38:19 UTC 2009

Modified Files:
src/sys/arch/mips/include [matt-nb5-mips64]: types.h
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c
process_machdep.c
src/sys/kern [matt-nb5-mips64]: core_elf32.c sys_process.c
src/sys/sys [matt-nb5-mips64]: ptrace.h

Log Message:
Change lazy fp load/save is done.  fpcurlwp is never NULL.
If no current lwp has the FP, then fpcurlwp is set to lwp0.
this allows many check for NULL and avoids a few null-derefs.
Since savefpregs clear COP1, loadfpregs can be called to reload
fpregs.  If it notices that situation, it just sets COP1 and returns
Save does not reset fpcurlwp, just clears COP1.  load does set fpcurlwp.

If MIPS3_SR_FR is set, all 32 64-bit FP registers are saved/restored via Xdc1.
If MIPS3_SR_FR is clear, only 32 32-bit FP register are saved/restore via Xwc1.
This preserves the existing ABI.


To generate a diff of this commit:
cvs rdiff -u -r1.43.36.2 -r1.43.36.3 src/sys/arch/mips/include/types.h
cvs rdiff -u -r1.205.4.1.2.1.2.2 -r1.205.4.1.2.1.2.3 \
src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.29.62.1 -r1.29.62.2 src/sys/arch/mips/mips/process_machdep.c
cvs rdiff -u -r1.32.16.1 -r1.32.16.2 src/sys/kern/core_elf32.c
cvs rdiff -u -r1.143.4.1 -r1.143.4.1.4.1 src/sys/kern/sys_process.c
cvs rdiff -u -r1.40 -r1.40.28.1 src/sys/sys/ptrace.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/types.h
diff -u src/sys/arch/mips/include/types.h:1.43.36.2 src/sys/arch/mips/include/types.h:1.43.36.3
--- src/sys/arch/mips/include/types.h:1.43.36.2	Fri Aug 21 17:29:42 2009
+++ src/sys/arch/mips/include/types.h	Sun Aug 23 03:38:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.43.36.2 2009/08/21 17:29:42 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.43.36.3 2009/08/23 03:38:19 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -110,6 +110,7 @@
 
 #define	__HAVE_AST_PERPROC
 #define	__HAVE_SYSCALL_INTERN
+#define	__HAVE_PROCESS_XFPREGS
 #ifdef MIPS3_PLUS	/* XXX bogus! */
 #define	__HAVE_CPU_COUNTER
 #endif

Index: src/sys/arch/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.2 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.3
--- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.2	Fri Aug 21 17:48:57 2009
+++ src/sys/arch/mips/mips/mips_machdep.c	Sun Aug 23 03:38:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.2 2009/08/21 17:48:57 matt Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.3 2009/08/23 03:38:19 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.2 2009/08/21 17:48:57 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.3 2009/08/23 03:38:19 matt Exp $);
 
 #include opt_cputype.h
 
@@ -783,6 +783,7 @@
 	 */
 	lwp0.l_cpu = cpu_info_store;
 	cpu_info_store.ci_curlwp = lwp0;
+	cpu_info_store.ci_fpcurlwp = lwp0;
 	curlwp = lwp0;
 
 	mycpu = NULL;
@@ -1119,6 +1120,15 @@
 	f-f_regs[_R_PC] = (int)pack-ep_entry  ~3;
 	f-f_regs[_R_T9] = (int)pack-ep_entry  ~3; /* abicall requirement */
 	f-f_regs[_R_SR] = PSL_USERSET;
+#if !defined(__mips_o32)
+	/*
+	 * allow 64bit ops in userland for non-O32 ABIs
+	 */
+	if (l-l_proc-p_md.md_abi != _MIPS_BSD_API_O32)
+		f-f_regs[_R_SR] |= MIPS_SR_UX;
+	if (_MIPS_SIM_NEWABI_P(l-l_proc-p_md.md_abi))
+		f-f_regs[_R_SR] |= MIPS3_SR_FR;
+#endif
 	/*
 	 * Set up arguments for _start():
 	 *	_start(stack, obj, cleanup, ps_strings);
@@ -1134,7 +1144,7 @@
 	f-f_regs[_R_A3] = (intptr_t)l-l_proc-p_psstr;
 
 	if ((l-l_md.md_flags  MDP_FPUSED)  l == fpcurlwp)
-		fpcurlwp = NULL;
+		fpcurlwp = lwp0;
 	memset(l-l_addr-u_pcb.pcb_fpregs, 0, sizeof(struct fpreg));
 	l-l_md.md_flags = ~MDP_FPUSED;
 	l-l_md.md_ss_addr = 0;
@@ -1493,171 +1503,273 @@
 }
 
 void
-savefpregs(l)
-	struct lwp *l;
+savefpregs(struct lwp *l)
 {
 #ifndef NOFPU
-	u_int32_t status, fpcsr;
-	mips_fpreg_t *fp;
-	struct frame *f;
-
-	if (l == NULL)
+	struct frame * const f = l-l_md.md_regs;
+	mips_fpreg_t * const fp = l-l_addr-u_pcb.pcb_fpregs.r_regs;
+	uint32_t status, fpcsr;
+	
+	/*
+	 * Don't do anything if the FPU is already off.
+	 */
+	if ((f-f_regs[_R_SR]  MIPS_SR_COP_1_BIT) == 0)
 		return;
+
+	/*
+	 * this process yielded FPA.
+	 */
+	KASSERT(f-f_regs[_R_SR]  MIPS_SR_COP_1_BIT);	/* it should be on */
+
 	/*
 	 * turnoff interrupts enabling CP1 to read FPCSR register.
 	 */
 	__asm volatile (
-		.set noreorder	\n\t
-		.set noat	\n\t
-		mfc0	%0, $ ___STRING(MIPS_COP_0_STATUS) 	\n\t
-		li	$1, %2	\n\t
-		mtc0	$1, $ ___STRING(MIPS_COP_0_STATUS) 	\n\t
+		.set noreorder\n\t
+		.set noat	\n\t
+		mfc0	%0, $ ___STRING(MIPS_COP_0_STATUS) 	\n\t
+		mtc0	%2, $ ___STRING(MIPS_COP_0_STATUS)	\n\t
 	

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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:39:29 UTC 2009

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

Log Message:
Enable ELF64


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/sbmips/include/loadfile_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/sbmips/include/loadfile_machdep.h
diff -u src/sys/arch/sbmips/include/loadfile_machdep.h:1.3 src/sys/arch/sbmips/include/loadfile_machdep.h:1.3.18.1
--- src/sys/arch/sbmips/include/loadfile_machdep.h:1.3	Mon Apr 28 20:23:34 2008
+++ src/sys/arch/sbmips/include/loadfile_machdep.h	Sun Aug 23 03:39:29 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: loadfile_machdep.h,v 1.3 2008/04/28 20:23:34 martin Exp $	*/
+/*	$NetBSD: loadfile_machdep.h,v 1.3.18.1 2009/08/23 03:39:29 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,6 +30,7 @@
  */
 
 #define BOOT_ELF32
+#define BOOT_ELF64
 
 #define LOAD_KERNEL	(LOAD_ALL  ~LOAD_TEXTA)
 #define COUNT_KERNEL	(COUNT_ALL  ~COUNT_TEXTA)



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:40:15 UTC 2009

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

Log Message:
Make sure we only don't run other sized ELFs.


To generate a diff of this commit:
cvs rdiff -u -r1.10.96.4 -r1.10.96.5 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.4 src/sys/arch/mips/include/elf_machdep.h:1.10.96.5
--- src/sys/arch/mips/include/elf_machdep.h:1.10.96.4	Sat Aug 22 06:46:45 2009
+++ src/sys/arch/mips/include/elf_machdep.h	Sun Aug 23 03:40:14 2009
@@ -1,23 +1,31 @@
-/*	$NetBSD: elf_machdep.h,v 1.10.96.4 2009/08/22 06:46:45 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.10.96.5 2009/08/23 03:40:14 matt Exp $	*/
 
 #ifndef _MIPS_ELF_MACHDEP_H_
 #define  _MIPS_ELF_MACHDEP_H_
 
 #if defined(ELFSIZE)
 #if ELFSIZE == 32
+#ifdef _LP64
+#define	ELF32_MACHDEP_ID_CASES		/* xxx */
+#else
 #define	ELF32_MACHDEP_ID_CASES		\
 		case EM_MIPS:		\
 			break;
+#endif /* _LP64 */
 
 #define	ELF32_MACHDEP_ID	EM_MIPS
-#endif
+#endif /* ELFSIZE == 32 */
 #if ELFSIZE == 64
+#ifdef _LP64
 #define	ELF64_MACHDEP_ID_CASES		\
 		case EM_MIPS:		\
 			break;
+#else
+#define	ELF64_MACHDEP_ID_CASES		/* xxx */
+#endif /* _LP64 */
 
 #define	ELF64_MACHDEP_ID	EM_MIPS
-#endif
+#endif /* ELFSIZE == 64 */
 #endif /* defined(ELFSIZE) */
 
 #ifdef _LP64



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:43:33 UTC 2009

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

Log Message:
Compile MALTA with -mmips64


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

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/evbmips/conf/std.malta
diff -u src/sys/arch/evbmips/conf/std.malta:1.5 src/sys/arch/evbmips/conf/std.malta:1.5.94.1
--- src/sys/arch/evbmips/conf/std.malta:1.5	Sun Dec 11 12:17:11 2005
+++ src/sys/arch/evbmips/conf/std.malta	Sun Aug 23 03:43:33 2009
@@ -1,4 +1,4 @@
-# $NetBSD: std.malta,v 1.5 2005/12/11 12:17:11 christos Exp $
+# $NetBSD: std.malta,v 1.5.94.1 2009/08/23 03:43:33 matt Exp $
 
 machine evbmips mips
 include		conf/std	# MI standard options
@@ -11,6 +11,7 @@
 options	EXEC_ELF32	# exec ELF32 binaries
 options	EXEC_SCRIPT	# exec #! scripts
 
+makeoptions	CFLAGS+=-mips64
 makeoptions	DEFTEXTADDR=0x8010
 makeoptions	BOARDTYPE=malta
 



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 03:57:42 UTC 2009

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

Log Message:
Use #if defined(__mips_xxx) not #if __mips_xxx


To generate a diff of this commit:
cvs rdiff -u -r1.12.78.2 -r1.12.78.3 src/sys/arch/mips/include/cdefs.h

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

Modified files:

Index: src/sys/arch/mips/include/cdefs.h
diff -u src/sys/arch/mips/include/cdefs.h:1.12.78.2 src/sys/arch/mips/include/cdefs.h:1.12.78.3
--- src/sys/arch/mips/include/cdefs.h:1.12.78.2	Fri Aug 21 17:18:32 2009
+++ src/sys/arch/mips/include/cdefs.h	Sun Aug 23 03:57:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.12.78.2 2009/08/21 17:18:32 matt Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.12.78.3 2009/08/23 03:57:42 matt Exp $	*/
 
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
@@ -54,11 +54,11 @@
 #define	_MIPS_SIM_LP64_P(abi)	((abi) == _MIPS_SIM_ABIX32 || \
  (abi) == _MIPS_SIM_ABI64)
 
-#if __mips_n64
+#if defined(__mips_n64)
 #define	_MIPS_BSD_API		_MIPS_BSD_API_N64
-#elif __mips_n32
+#elif defined(__mips_n32)
 #define	_MIPS_BSD_API		_MIPS_BSD_API_N32
-#elif __mips_o64
+#elif defined(__mips_o64)
 #define	_MIPS_BSD_API		_MIPS_BSD_API_O64
 #else
 #define	_MIPS_BSD_API		_MIPS_BSD_API_O32



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

2009-08-22 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sun Aug 23 04:04:35 UTC 2009

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

Log Message:
In non-O32 kernels, make these syscalls return ENOSYS or sigexit(l, SIGILL)
when called by non-O32 programs.  Marshall the 64bits registers to and from
their 32bit equivs and deal with FP differences.


To generate a diff of this commit:
cvs rdiff -u -r1.27.92.1 -r1.27.92.2 src/sys/arch/mips/include/signal.h
cvs rdiff -u -r1.16.20.1 -r1.16.20.2 \
src/sys/arch/mips/mips/compat_13_machdep.c
cvs rdiff -u -r1.12.14.1 -r1.12.14.2 \
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/include/signal.h
diff -u src/sys/arch/mips/include/signal.h:1.27.92.1 src/sys/arch/mips/include/signal.h:1.27.92.2
--- src/sys/arch/mips/include/signal.h:1.27.92.1	Sun Aug 16 03:33:58 2009
+++ src/sys/arch/mips/include/signal.h	Sun Aug 23 04:04:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.27.92.1 2009/08/16 03:33:58 matt Exp $	*/
+/*	$NetBSD: signal.h,v 1.27.92.2 2009/08/23 04:04:35 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -86,18 +86,22 @@
 #endif /* _KERNEL  COMPAT_13 */
 
 #if defined(_LIBC) || (defined(_KERNEL)  (defined(COMPAT_16) || defined(COMPAT_ULTRIX)))
+/*
+ * Only need an O32 version.
+ */
 struct sigcontext {
 	int	sc_onstack;	/* sigstack state to restore */
 	int	__sc_mask13;	/* signal mask to restore (old style) */
-	mips_reg_t sc_pc;	/* pc at time of signal */
-	mips_reg_t sc_regs[32];	/* processor regs 0 to 31 */
-	mips_reg_t mullo, mulhi;/* mullo and mulhi registers... */
+	int	sc_pc;		/* pc at time of signal */
+	int	sc_regs[32];	/* processor regs 0 to 31 */
+	int	mullo, mulhi;	/* mullo and mulhi registers... */
 	int	sc_fpused;	/* fp has been used */
-	mips_fpreg_t sc_fpregs[33];	/* fp regs 0 to 31 and csr */
+	int	sc_fpregs[33];	/* fp regs 0 to 31 and csr */
 	int	sc_fpc_eir;	/* floating point exception instruction reg */
-	long	sc_xxx[8];	/* XXX reserved */
+	int	sc_xxx[8];	/* XXX reserved */
 	sigset_t sc_mask;	/* signal mask to restore (new style) */
 };
+
 #endif /* _LIBC || _KERNEL */
 
 #endif	/* !_LANGUAGE_ASSEMBLY */

Index: src/sys/arch/mips/mips/compat_13_machdep.c
diff -u src/sys/arch/mips/mips/compat_13_machdep.c:1.16.20.1 src/sys/arch/mips/mips/compat_13_machdep.c:1.16.20.2
--- src/sys/arch/mips/mips/compat_13_machdep.c:1.16.20.1	Thu Aug 20 21:49:24 2009
+++ src/sys/arch/mips/mips/compat_13_machdep.c	Sun Aug 23 04:04:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_13_machdep.c,v 1.16.20.1 2009/08/20 21:49:24 matt Exp $	*/
+/*	$NetBSD: compat_13_machdep.c,v 1.16.20.2 2009/08/23 04:04:35 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.20.1 2009/08/20 21:49:24 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: compat_13_machdep.c,v 1.16.20.2 2009/08/23 04:04:35 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -39,6 +39,10 @@
 #define SDB_FPSTATE	0x04
 #endif
 
+#if !defined(__mips_o32)
+#define	fpreg		fpreg_oabi
+#endif
+
 int
 compat_13_sys_sigreturn(struct lwp *l, const struct compat_13_sys_sigreturn_args *uap, register_t *retval)
 {
@@ -51,6 +55,11 @@
 	struct frame *f;
 	sigset_t mask;
 
+#if !defined(__mips_o32)
+	if (p-p_md.md_abi != _MIPS_BSD_ABI_O32)
+		return ENOSYS;
+#endif
+
 	/*
 	 * The trampoline code hands us the context.
 	 * It is unsafe to keep track of it ourselves, in the event that a
@@ -64,7 +73,7 @@
 	if ((error = copyin(scp, ksc, sizeof(ksc))) != 0)
 		return (error);
 
-	if ((u_int)ksc.sc_regs[_R_ZERO] != 0xacedbadeU)/* magic number */
+	if ((uint32_t)ksc.sc_regs[_R_ZERO] != 0xacedbadeU)/* magic number */
 		return (EINVAL);
 
 	/* Resture the register context. */
@@ -72,10 +81,16 @@
 	f-f_regs[_R_PC] = ksc.sc_pc;
 	f-f_regs[_R_MULLO] = ksc.mullo;
 	f-f_regs[_R_MULHI] = ksc.mulhi;
+#if defined(__mips_o32)
 	memcpy(f-f_regs[1], scp-sc_regs[1],
 	sizeof(scp-sc_regs) - sizeof(scp-sc_regs[0]));
+#else
+	for (size_t i = 1; i  __arraycount(scp-sc_regs); i++)
+		f-f_regs[i] = scp-sc_regs[i];
+#endif
 	if (scp-sc_fpused)
-		l-l_addr-u_pcb.pcb_fpregs = *(struct fpreg *)scp-sc_fpregs;
+		*(struct fpreg *)l-l_addr-u_pcb.pcb_fpregs =
+		*(struct fpreg *)scp-sc_fpregs;
 
 	mutex_enter(p-p_lock);
 

Index: src/sys/arch/mips/mips/compat_16_machdep.c
diff -u src/sys/arch/mips/mips/compat_16_machdep.c:1.12.14.1 src/sys/arch/mips/mips/compat_16_machdep.c:1.12.14.2
--- src/sys/arch/mips/mips/compat_16_machdep.c:1.12.14.1	Thu Aug 20 21:45:59 2009
+++ src/sys/arch/mips/mips/compat_16_machdep.c	Sun Aug 23 04:04:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_machdep.c,v 1.12.14.1