CVS commit: src/tools/compat

2018-03-11 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Sun Mar 11 10:14:04 UTC 2018

Modified Files:
src/tools/compat: regex.h

Log Message:
Fix build of tools/lex on platforms lacking sys/cdefs.h by including
nbtool_config.h in tools/compat/regex.h. Tested on illumos.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tools/compat/regex.h

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

Modified files:

Index: src/tools/compat/regex.h
diff -u src/tools/compat/regex.h:1.3 src/tools/compat/regex.h:1.4
--- src/tools/compat/regex.h:1.3	Sun Mar  6 10:22:59 2016
+++ src/tools/compat/regex.h	Sun Mar 11 10:14:04 2018
@@ -1,3 +1,4 @@
-/*	$NetBSD: regex.h,v 1.3 2016/03/06 10:22:59 aymeric Exp $ */
+/*	$NetBSD: regex.h,v 1.4 2018/03/11 10:14:04 hans Exp $ */
 
+#include "nbtool_config.h"
 #include "../../include/regex.h"



CVS commit: src/sys/arch/arm/omap

2014-04-09 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Wed Apr  9 20:52:14 UTC 2014

Modified Files:
src/sys/arch/arm/omap: if_cpsw.c

Log Message:
Fix build in non-debug kernels, mark eopi __diagused in cpsw_start().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/if_cpsw.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/omap/if_cpsw.c
diff -u src/sys/arch/arm/omap/if_cpsw.c:1.5 src/sys/arch/arm/omap/if_cpsw.c:1.6
--- src/sys/arch/arm/omap/if_cpsw.c:1.5	Wed Feb 26 03:58:33 2014
+++ src/sys/arch/arm/omap/if_cpsw.c	Wed Apr  9 20:52:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.5 2014/02/26 03:58:33 ozaki-r Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.6 2014/04/09 20:52:14 hans Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: if_cpsw.c,v 1.5 2014/02/26 03:58:33 ozaki-r Exp $);
+__KERNEL_RCSID(1, $NetBSD: if_cpsw.c,v 1.6 2014/04/09 20:52:14 hans Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -527,7 +527,7 @@ cpsw_start(struct ifnet *ifp)
 	uint32_t * const dw = bd.word;
 	struct mbuf *m;
 	bus_dmamap_t dm;
-	u_int eopi = ~0;
+	u_int eopi __diagused = ~0;
 	u_int seg;
 	u_int txfree;
 	int txstart = -1;



CVS commit: src/sys/arch/arm/omap

2014-04-09 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Wed Apr  9 21:02:32 UTC 2014

Modified Files:
src/sys/arch/arm/omap: obio_com.c

Log Message:
Fix build of non-debug kernels, mark err __diagused in uart_enable().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/omap/obio_com.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/omap/obio_com.c
diff -u src/sys/arch/arm/omap/obio_com.c:1.4 src/sys/arch/arm/omap/obio_com.c:1.5
--- src/sys/arch/arm/omap/obio_com.c:1.4	Fri Jul  1 20:30:21 2011
+++ src/sys/arch/arm/omap/obio_com.c	Wed Apr  9 21:02:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio_com.c,v 1.4 2011/07/01 20:30:21 dyoung Exp $	*/
+/*	$NetBSD: obio_com.c,v 1.5 2014/04/09 21:02:31 hans Exp $	*/
 
 /*
  * Based on arch/arm/omap/omap_com.c
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: obio_com.c,v 1.4 2011/07/01 20:30:21 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: obio_com.c,v 1.5 2014/04/09 21:02:31 hans Exp $);
 
 #include opt_omap.h
 #include opt_com.h
@@ -171,7 +171,7 @@ uart_enable(struct obio_attach_args *obi
 #endif
 	uint32_t fclken1;
 	uint32_t iclken1;
-	int err;
+	int err __diagused;
 	int n=-1;
 
 	KASSERT(obio != NULL);



CVS commit: src

2013-02-21 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Thu Feb 21 15:13:11 UTC 2013

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf
src/etc/etc.evbarm: Makefile.inc

Log Message:
Use HOST_SH to run scripts. Makes mkimage work on SunOS.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.46 -r1.47 src/etc/etc.evbarm/Makefile.inc

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.8 src/distrib/utils/embedded/conf/evbarm.conf:1.9
--- src/distrib/utils/embedded/conf/evbarm.conf:1.8	Tue Feb 12 12:04:39 2013
+++ src/distrib/utils/embedded/conf/evbarm.conf	Thu Feb 21 15:13:10 2013
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.8 2013/02/12 12:04:39 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.9 2013/02/21 15:13:10 hans Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -84,7 +84,7 @@ EOF
 		exit 1
 	fi
 	echo ${bar} running MAKEDEV ${bar}
-	(cd ${mnt}/dev  sh ${release}/dev/MAKEDEV all)
+	(cd ${mnt}/dev  ${HOST_SH} ${release}/dev/MAKEDEV all)
 
 	echo ${bar} creating directories ${bar}
 	mkdir ${mnt}/proc ${mnt}/kern

Index: src/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.46 src/etc/etc.evbarm/Makefile.inc:1.47
--- src/etc/etc.evbarm/Makefile.inc:1.46	Wed Feb 20 09:03:41 2013
+++ src/etc/etc.evbarm/Makefile.inc	Thu Feb 21 15:13:11 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.46 2013/02/20 09:03:41 skrll Exp $
+#	$NetBSD: Makefile.inc,v 1.47 2013/02/21 15:13:11 hans Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -28,7 +28,8 @@ __mkimage: .USE
 	TOOL_MKNOD=${TOOL_MKNOD} \
 	TOOL_PAX=${TOOL_PAX} \
 	TOOL_MTREE=${TOOL_MTREE} \
-	${MKIMAGE} -x -h ${.TARGET:S/smp_//} -D ${DESTDIR} \
+	HOST_SH=${HOST_SH} \
+	${HOST_SH} ${MKIMAGE} -x -h ${.TARGET:S/smp_//} -D ${DESTDIR} \
 	-K ${.ALLSRC} -S ${NETBSDSRCDIR} \
 	${IMAGE.dir}/${.TARGET:S/smp_//}.img.gz
 



CVS commit: src/external/bsd/elftosb/dist/common

2013-02-21 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Thu Feb 21 15:56:07 UTC 2013

Modified Files:
src/external/bsd/elftosb/dist/common: EncoreBootImage.cpp

Log Message:
Make this build on SunOS.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/bsd/elftosb/dist/common/EncoreBootImage.cpp

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

Modified files:

Index: src/external/bsd/elftosb/dist/common/EncoreBootImage.cpp
diff -u src/external/bsd/elftosb/dist/common/EncoreBootImage.cpp:1.2 src/external/bsd/elftosb/dist/common/EncoreBootImage.cpp:1.3
--- src/external/bsd/elftosb/dist/common/EncoreBootImage.cpp:1.2	Sat Feb 16 13:33:10 2013
+++ src/external/bsd/elftosb/dist/common/EncoreBootImage.cpp	Thu Feb 21 15:56:07 2013
@@ -391,7 +391,7 @@ void EncoreBootImage::prepareImageHeader
 //! \bug The timestamp might be off an hour.
 uint64_t EncoreBootImage::getTimestamp()
 {
-#if defined(WIN32) || defined(__CYGWIN__)
+#if defined(WIN32) || defined(__CYGWIN__) || defined(__sun)
 	struct tm epoch = { 0, 0, 0, 1, 0, 100, 0, 0 }; // 00:00 1-1-2000
 #else
 	struct tm epoch = { 0, 0, 0, 1, 0, 100, 0, 0, 1, 0, NULL }; // 00:00 1-1-2000



CVS commit: src/etc/rc.d

2012-07-08 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Sun Jul  8 14:25:49 UTC 2012

Modified Files:
src/etc/rc.d: random_seed

Log Message:
It's msdos, not msdosfs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/random_seed

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

Modified files:

Index: src/etc/rc.d/random_seed
diff -u src/etc/rc.d/random_seed:1.1 src/etc/rc.d/random_seed:1.2
--- src/etc/rc.d/random_seed:1.1	Wed Nov 23 10:47:48 2011
+++ src/etc/rc.d/random_seed	Sun Jul  8 14:25:49 2012
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: random_seed,v 1.1 2011/11/23 10:47:48 tls Exp $
+# $NetBSD: random_seed,v 1.2 2012/07/08 14:25:49 hans Exp $
 #
 
 # PROVIDE: random_seed
@@ -34,7 +34,7 @@ fs_safe()
 	ext2fs)
 		return 0;
 		;;
-	msdosfs)
+	msdos)
 		return 0;
 		;;
 	v7fs)



CVS commit: src/sys/arch/arm/marvell

2012-06-19 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Tue Jun 19 16:50:44 UTC 2012

Modified Files:
src/sys/arch/arm/marvell: files.marvell mvsoctmr.c

Log Message:
Add support for the watchdog timer in mvsoctmr.
Tested on DreamPlug system.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/marvell/files.marvell
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/marvell/mvsoctmr.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/marvell/files.marvell
diff -u src/sys/arch/arm/marvell/files.marvell:1.4 src/sys/arch/arm/marvell/files.marvell:1.5
--- src/sys/arch/arm/marvell/files.marvell:1.4	Sat Mar 12 22:34:52 2011
+++ src/sys/arch/arm/marvell/files.marvell	Tue Jun 19 16:50:44 2012
@@ -1,4 +1,4 @@
-#   $NetBSD: files.marvell,v 1.4 2011/03/12 22:34:52 nonaka Exp $
+#   $NetBSD: files.marvell,v 1.5 2012/06/19 16:50:44 hans Exp $
 #
 # Configuration info for Marvell System on Chip support
 #
@@ -24,7 +24,7 @@ file	arch/arm/marvell/kirkwood.c		kirkwo
 include dev/marvell/files.discovery
 
 # Timers
-device	mvsoctmr
+device	mvsoctmr: sysmon_wdog
 attach	mvsoctmr at mvsoc
 file	arch/arm/marvell/mvsoctmr.c		mvsoctmr
 

Index: src/sys/arch/arm/marvell/mvsoctmr.c
diff -u src/sys/arch/arm/marvell/mvsoctmr.c:1.3 src/sys/arch/arm/marvell/mvsoctmr.c:1.4
--- src/sys/arch/arm/marvell/mvsoctmr.c:1.3	Sun Feb 12 16:34:07 2012
+++ src/sys/arch/arm/marvell/mvsoctmr.c	Tue Jun 19 16:50:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsoctmr.c,v 1.3 2012/02/12 16:34:07 matt Exp $	*/
+/*	$NetBSD: mvsoctmr.c,v 1.4 2012/06/19 16:50:44 hans Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v 1.3 2012/02/12 16:34:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v 1.4 2012/06/19 16:50:44 hans Exp $);
+
+#include opt_ddb.h
 
 #include sys/param.h
 #include sys/atomic.h
@@ -36,6 +38,7 @@ __KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v
 #include sys/time.h
 #include sys/timetc.h
 #include sys/systm.h
+#include sys/wdog.h
 
 #include machine/intr.h
 
@@ -47,10 +50,21 @@ __KERNEL_RCSID(0, $NetBSD: mvsoctmr.c,v
 
 #include dev/marvell/marvellvar.h
 
+#include dev/sysmon/sysmonvar.h
+
+#ifdef DDB
+#include machine/db_machdep.h
+#include ddb/db_extern.h
+#endif
+
 
 struct mvsoctmr_softc {
 	device_t sc_dev;
 
+	struct sysmon_wdog sc_wdog;
+	uint32_t sc_wdog_period;
+	uint32_t sc_wdog_armed;
+
 	bus_space_tag_t sc_iot;
 	bus_space_handle_t sc_ioh;
 };
@@ -65,6 +79,16 @@ static u_int mvsoctmr_get_timecount(stru
 
 static void mvsoctmr_cntl(struct mvsoctmr_softc *, int, u_int, int, int);
 
+static int mvsoctmr_wdog_tickle(struct sysmon_wdog *);
+static int mvsoctmr_wdog_setmode(struct sysmon_wdog *);
+
+#ifdef DDB
+static struct mvsoctmr_softc *mvsoctmr_softc;
+static void mvsoctmr_wdog_ddb_trap(int);
+#endif
+
+#define MVSOC_WDOG_MAX_PERIOD	21
+
 static struct mvsoctmr_softc *mvsoctmr_sc;
 static struct timecounter mvsoctmr_timecounter = {
 	mvsoctmr_get_timecount,	/* get_timecount */
@@ -102,6 +126,7 @@ mvsoctmr_attach(device_t parent, device_
 {
 struct mvsoctmr_softc *sc = device_private(self);
 	struct marvell_attach_args *mva = aux;
+	uint32_t rstoutn;
 
 	aprint_naive(\n);
 	aprint_normal(: Marvell SoC Timer\n);
@@ -117,6 +142,29 @@ mvsoctmr_attach(device_t parent, device_
 
 	mvsoctmr_timecounter.tc_name = device_xname(self);
 	mvsoctmr_cntl(sc, MVSOCTMR_TIMER1, 0x, 1, 1);
+
+	/*
+	 * stop watchdog timer, enable watchdog timer resets
+	 */
+	mvsoctmr_cntl(sc, MVSOCTMR_WATCHDOG, 0, 0, 0);
+	rstoutn = read_mlmbreg(MVSOC_MLMB_RSTOUTNMASKR);
+	write_mlmbreg(MVSOC_MLMB_RSTOUTNMASKR,
+		  rstoutn | MVSOC_MLMB_RSTOUTNMASKR_WDRSTOUTEN);
+
+#ifdef DDB
+	mvsoctmr_softc = sc;
+	db_trap_callback = mvsoctmr_wdog_ddb_trap;
+#endif
+
+	sc-sc_wdog.smw_name = device_xname(self);
+	sc-sc_wdog.smw_cookie = sc;
+	sc-sc_wdog.smw_setmode = mvsoctmr_wdog_setmode;
+	sc-sc_wdog.smw_tickle = mvsoctmr_wdog_tickle;
+	sc-sc_wdog.smw_period = MVSOC_WDOG_MAX_PERIOD;
+
+	if (sysmon_wdog_register(sc-sc_wdog) != 0)
+		aprint_error_dev(self,
+ unable to register watchdog with sysmon\n);
 }
 
 /*
@@ -257,3 +305,54 @@ mvsoctmr_cntl(struct mvsoctmr_softc *sc,
 		ctrl = ~MVSOCTMR_CTCR_CPUTIMERAUTO(num);
 	bus_space_write_4(sc-sc_iot, sc-sc_ioh, MVSOCTMR_CTCR, ctrl);
 }
+
+static int
+mvsoctmr_wdog_setmode(struct sysmon_wdog *smw)
+{
+	struct mvsoctmr_softc *sc = smw-smw_cookie;
+
+	if ((smw-smw_mode  WDOG_MODE_MASK) == WDOG_MODE_DISARMED) {
+		sc-sc_wdog_armed = 0;
+		mvsoctmr_cntl(sc, MVSOCTMR_WATCHDOG, 0, 0, 0);
+	} else {
+		sc-sc_wdog_armed = 1;
+		if (smw-smw_period == WDOG_PERIOD_DEFAULT)
+			smw-smw_period = MVSOC_WDOG_MAX_PERIOD;
+		else if (smw-smw_period  MVSOC_WDOG_MAX_PERIOD ||
+			 smw-smw_period = 0)
+			return (EOPNOTSUPP);
+		sc-sc_wdog_period = smw-smw_period 

CVS commit: src/tools

2012-06-19 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Tue Jun 19 21:48:34 UTC 2012

Modified Files:
src/tools: Makefile.gnuhost

Log Message:
Don't use -print0/-0 in find | xargs, it is non-standard and not needed at all.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/tools/Makefile.gnuhost

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

Modified files:

Index: src/tools/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.38 src/tools/Makefile.gnuhost:1.39
--- src/tools/Makefile.gnuhost:1.38	Wed Apr 18 11:28:30 2012
+++ src/tools/Makefile.gnuhost	Tue Jun 19 21:48:33 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.38 2012/04/18 11:28:30 tsutsui Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.39 2012/06/19 21:48:33 hans Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -103,7 +103,7 @@ CONFIGURE_PLATFORM!= if [ -s .configure_
 configure_cleanup:
 	@mkdir build 2/dev/null || true
 	@(echo Cleaning stale cache files ${BUILD_PLATFORM} != ${CONFIGURE_PLATFORM})
-	@(cd build  find . -name config.cache -print0 | xargs -0 rm -f)
+	@(cd build  find . -name config.cache | xargs rm -f)
 configure_cleanup=configure_cleanup
 .endif
 



CVS commit: src/etc/rc.d

2011-06-15 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Wed Jun 15 13:42:46 UTC 2011

Modified Files:
src/etc/rc.d: fccache.in

Log Message:
remove -q argument, it is useless with Xorg and fails with XFree


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/rc.d/fccache.in

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

Modified files:

Index: src/etc/rc.d/fccache.in
diff -u src/etc/rc.d/fccache.in:1.1 src/etc/rc.d/fccache.in:1.2
--- src/etc/rc.d/fccache.in:1.1	Fri Feb 18 00:42:20 2011
+++ src/etc/rc.d/fccache.in	Wed Jun 15 13:42:46 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: fccache.in,v 1.1 2011/02/18 00:42:20 jmcneill Exp $
+# $NetBSD: fccache.in,v 1.2 2011/06/15 13:42:46 hans Exp $
 #
 
 # PROVIDE: fccache 
@@ -19,7 +19,7 @@
 {
 	if [ -x ${command} ]; then
 		echo -n Updating fontconfig cache:
-		${command} -q
+		${command}
 		echo  done
 	fi
 }



CVS commit: src/external/bsd/mdocml/dist

2011-06-01 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Wed Jun  1 15:52:49 UTC 2011

Modified Files:
src/external/bsd/mdocml/dist: read.c

Log Message:
include config.h


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/mdocml/dist/read.c

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

Modified files:

Index: src/external/bsd/mdocml/dist/read.c
diff -u src/external/bsd/mdocml/dist/read.c:1.1.1.1 src/external/bsd/mdocml/dist/read.c:1.2
--- src/external/bsd/mdocml/dist/read.c:1.1.1.1	Fri Apr 15 13:45:30 2011
+++ src/external/bsd/mdocml/dist/read.c	Wed Jun  1 15:52:48 2011
@@ -15,6 +15,10 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #include sys/stat.h
 #include sys/mman.h
 



CVS commit: src/sys/arch/alpha/common

2010-10-07 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Thu Oct  7 19:39:31 UTC 2010

Modified Files:
src/sys/arch/alpha/common: sgmap_typedep.c

Log Message:
fix SGMAP_DEBUG on alpha


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/alpha/common/sgmap_typedep.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/alpha/common/sgmap_typedep.c
diff -u src/sys/arch/alpha/common/sgmap_typedep.c:1.35 src/sys/arch/alpha/common/sgmap_typedep.c:1.36
--- src/sys/arch/alpha/common/sgmap_typedep.c:1.35	Mon Apr 28 20:23:11 2008
+++ src/sys/arch/alpha/common/sgmap_typedep.c	Thu Oct  7 19:39:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sgmap_typedep.c,v 1.35 2008/04/28 20:23:11 martin Exp $ */
+/* $NetBSD: sgmap_typedep.c,v 1.36 2010/10/07 19:39:30 hans Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: sgmap_typedep.c,v 1.35 2008/04/28 20:23:11 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: sgmap_typedep.c,v 1.36 2010/10/07 19:39:30 hans Exp $);
 
 #include opt_ddb.h
 
@@ -121,9 +121,12 @@
 		}
 	}
 
-#if 0
-	printf(len 0x%lx - 0x%lx, boundary 0x%lx - 0x%lx - ,
-	(endva - va), sgvalen, map-_dm_boundary, boundary);
+#ifdef SGMAP_DEBUG
+	if (__C(SGMAP_TYPE,_debug)) {
+		printf(sgmap_load: va:endva = 0x%lx:0x%lx\n, va, endva);
+		printf(sgmap_load: sgvalen = 0x%lx, boundary = 0x%lx\n,
+		   sgvalen, boundary);
+	}
 #endif
 
 	s = splvm();
@@ -133,10 +136,6 @@
 	if (error)
 		return (error);
 
-#if 0
-	printf(error %d sgva 0x%lx\n, error, sgva);
-#endif
-
 	pteidx = sgva  SGMAP_ADDR_PTEIDX_SHIFT;
 	pte = page_table[pteidx * SGMAP_PTE_SPACING];
 
@@ -153,8 +152,8 @@
 
 #ifdef SGMAP_DEBUG
 	if (__C(SGMAP_TYPE,_debug))
-		printf(sgmap_load: wbase = 0x%lx, vpage = 0x%x, 
-		DMA addr = 0x%lx\n, sgmap-aps_wbase, sgva,
+		printf(sgmap_load: wbase = 0x%lx, vpage = 0x%lx, 
+		DMA addr = 0x%lx\n, sgmap-aps_wbase, (uint64_t)sgva,
 		map-dm_segs[seg].ds_addr);
 #endif
 
@@ -181,9 +180,7 @@
 #ifdef SGMAP_DEBUG
 		if (__C(SGMAP_TYPE,_debug)) {
 			printf(sgmap_load: spill page, pte = %p, 
-			*pte = 0x%lx\n, pte, *pte);
-			printf(sgmap_load: pte count = %d\n,
-			map-_dm_ptecnt);
+			*pte = 0x%lx\n, pte, (uint64_t)*pte);
 		}
 #endif
 	}



CVS commit: src/sys/arch/alpha

2010-10-07 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Thu Oct  7 19:55:02 UTC 2010

Modified Files:
src/sys/arch/alpha/alpha: dec_6600.c
src/sys/arch/alpha/include: alpha_cpu.h logout.h
src/sys/arch/alpha/pci: tsc.c tsp_pci.c tsreg.h tsvar.h

Log Message:
Enable Pchip and Cchip error interrupts (machine checks) on DEC 6600
systems. Add some basic pretty-printing for those errors. Tested on
a DS20.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/alpha/alpha/dec_6600.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/alpha/include/alpha_cpu.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/alpha/include/logout.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/alpha/pci/tsc.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/alpha/pci/tsp_pci.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/alpha/pci/tsreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/alpha/pci/tsvar.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/alpha/alpha/dec_6600.c
diff -u src/sys/arch/alpha/alpha/dec_6600.c:1.29 src/sys/arch/alpha/alpha/dec_6600.c:1.30
--- src/sys/arch/alpha/alpha/dec_6600.c:1.29	Mon Sep 14 02:46:29 2009
+++ src/sys/arch/alpha/alpha/dec_6600.c	Thu Oct  7 19:55:02 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_6600.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $ */
+/* $NetBSD: dec_6600.c,v 1.30 2010/10/07 19:55:02 hans Exp $ */
 
 /*
  * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: dec_6600.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: dec_6600.c,v 1.30 2010/10/07 19:55:02 hans Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -44,6 +44,8 @@
 #include machine/autoconf.h
 #include machine/cpuconf.h
 #include machine/bus.h
+#include machine/alpha.h
+#include machine/logout.h
 
 #include dev/ic/comreg.h
 #include dev/ic/comvar.h
@@ -83,6 +85,10 @@
 void dec_6600_init(void);
 static void dec_6600_cons_init(void);
 static void dec_6600_device_register(struct device *, void *);
+static void dec_6600_mcheck(unsigned long, struct ev6_logout_area *);
+static void dec_6600_mcheck_sys(unsigned int, struct ev6_logout_area *);
+static void dec_6600_mcheck_handler(unsigned long, struct trapframe *,
+unsigned long, unsigned long);
 
 #ifdef KGDB
 #include machine/db_machdep.h
@@ -107,8 +113,11 @@
 	platform.iobus = tsc;
 	platform.cons_init = dec_6600_cons_init;
 	platform.device_register = dec_6600_device_register;
-	STQP(TS_C_DIM0) = 0UL;
-	STQP(TS_C_DIM1) = 0UL;
+	platform.mcheck_handler = dec_6600_mcheck_handler;
+
+	/* enable Cchip and Pchip error interrupts */
+	STQP(TS_C_DIM0) = 0xe000;
+	STQP(TS_C_DIM1) = 0xe000;
 }
 
 static void
@@ -362,3 +371,85 @@
 		found = 1;
 	}
 }
+
+
+static void
+dec_6600_mcheck(unsigned long vector, struct ev6_logout_area *la)
+{
+	const char *t = Unknown, *c = ;
+
+	if (vector == ALPHA_SYS_ERROR || vector == ALPHA_PROC_ERROR)
+		c =  Correctable;
+
+	switch (vector) {
+	case ALPHA_SYS_ERROR:
+	case ALPHA_SYS_MCHECK:
+		t = System;
+		break;
+
+	case ALPHA_PROC_ERROR:
+	case ALPHA_PROC_MCHECK:
+		t = Processor;
+		break;
+
+	case ALPHA_ENV_MCHECK:
+		t = Environmental;
+		break;
+	}
+
+	printf(\n%s%s Machine Check (%lx): 
+	   Rev 0x%x, Code 0x%x, Flags 0x%x\n\n,
+	   t, c, vector, la-mchk_rev, la-mchk_code, la-la.la_flags);
+}
+
+static void
+dec_6600_mcheck_sys(unsigned int indent, struct ev6_logout_area *la)
+{
+	struct ev6_logout_sys *ls = 
+		(struct ev6_logout_sys *)ALPHA_LOGOUT_SYSTEM_AREA(la-la);
+
+#define FMT	%-30s = 0x%016lx\n
+
+	IPRINTF(indent, FMT, Software Error Summary Flags, ls-flags);
+
+	IPRINTF(indent, FMT, CPU Device Interrupt Requests, ls-dir);
+	tsc_print_dir(indent + 1, ls-dir);
+
+	IPRINTF(indent, FMT, Cchip Miscellaneous Register, ls-misc);
+	tsc_print_misc(indent + 1, ls-misc);
+
+	IPRINTF(indent, FMT, Pchip 0 Error Register, ls-p0_error);
+	if (ls-flags  0x5)
+		tsp_print_error(indent + 1, ls-p0_error);
+
+	IPRINTF(indent, FMT, Pchip 1 Error Register, ls-p1_error);
+	if (ls-flags  0x6)
+		tsp_print_error(indent + 1, ls-p1_error);
+}
+
+static void
+dec_6600_mcheck_handler(unsigned long mces, struct trapframe *framep,
+			unsigned long vector, unsigned long param)
+{
+	struct mchkinfo *mcp;
+	struct ev6_logout_area *la = (struct ev6_logout_area *)param;
+
+	/*
+	 * If we expected a machine check, just go handle it in common code.
+	 */
+	mcp = curcpu()-ci_mcinfo;
+	if (mcp-mc_expected) 
+		machine_check(mces, framep, vector, param);
+
+	dec_6600_mcheck(vector, la);
+
+	switch (vector) {
+	case ALPHA_SYS_ERROR:
+	case ALPHA_SYS_MCHECK:
+		dec_6600_mcheck_sys(1, la);
+		break;
+
+	}
+
+	machine_check(mces, framep, vector, param);
+}

Index: src/sys/arch/alpha/include/alpha_cpu.h
diff -u src/sys/arch/alpha/include/alpha_cpu.h:1.48 src/sys/arch/alpha/include/alpha_cpu.h:1.49
--- 

CVS commit: src/tests/lib/libpthread

2010-07-29 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Thu Jul 29 12:56:16 UTC 2010

Modified Files:
src/tests/lib/libpthread: t_join.c

Log Message:
Revert to 1.1 and fix the casts by using uintptr_t.  Ok jruoho.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libpthread/t_join.c

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

Modified files:

Index: src/tests/lib/libpthread/t_join.c
diff -u src/tests/lib/libpthread/t_join.c:1.3 src/tests/lib/libpthread/t_join.c:1.4
--- src/tests/lib/libpthread/t_join.c:1.3	Thu Jul 29 12:17:31 2010
+++ src/tests/lib/libpthread/t_join.c	Thu Jul 29 12:56:16 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: t_join.c,v 1.3 2010/07/29 12:17:31 jruoho Exp $ */
+/* $NetBSD: t_join.c,v 1.4 2010/07/29 12:56:16 hans Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_join.c,v 1.3 2010/07/29 12:17:31 jruoho Exp $);
+__RCSID($NetBSD: t_join.c,v 1.4 2010/07/29 12:56:16 hans Exp $);
 
 #include errno.h
 #include pthread.h
@@ -64,8 +64,8 @@
 {
 	pthread_t thread[25];
 	pthread_t caller;
-	void *val;
-	size_t i;
+	void *val = NULL;
+	uintptr_t i;
 	int rv;
 
 	caller = pthread_self();
@@ -86,7 +86,7 @@
 
 		error = true;
 
-		rv = pthread_create(thread[i], NULL, threadfunc2, NULL);
+		rv = pthread_create(thread[i], NULL, threadfunc2, (void *)i);
 
 		ATF_REQUIRE_EQ(rv, 0);
 
@@ -102,9 +102,11 @@
 		 */
 		PTHREAD_REQUIRE(pthread_join(thread[i], val));
 
-		ATF_REQUIRE(val == NULL);
 		ATF_REQUIRE_EQ(error, false);
 
+		ATF_REQUIRE(val != NULL);
+		ATF_REQUIRE(val == (void *)(i + 1));
+
 		/*
 		 * Once the thread has returned, ESRCH should
 		 * again follow if we try to join it again.
@@ -129,15 +131,15 @@
 static void *
 threadfunc2(void *arg)
 {
-	static int i = 0;
-	int j;
+	static uintptr_t i = 0;
+	uintptr_t j;
 
-	j = (int)arg;
+	j = (uintptr_t)arg;
 
 	if (i++ == j)
 		error = false;
 
-	pthread_exit(NULL);
+	pthread_exit((void *)i);
 
 	return NULL;
 }



CVS commit: src/sys/arch/vax/vsa

2010-05-09 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Sun May  9 22:19:46 UTC 2010

Modified Files:
src/sys/arch/vax/vsa: spx.c

Log Message:
Make SPX work as console device on VAXstation 4000/9x.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/vax/vsa/spx.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/vax/vsa/spx.c
diff -u src/sys/arch/vax/vsa/spx.c:1.2 src/sys/arch/vax/vsa/spx.c:1.3
--- src/sys/arch/vax/vsa/spx.c:1.2	Wed Mar 18 16:00:16 2009
+++ src/sys/arch/vax/vsa/spx.c	Sun May  9 22:19:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: spx.c,v 1.2 2009/03/18 16:00:16 cegger Exp $ */
+/*	$NetBSD: spx.c,v 1.3 2010/05/09 22:19:46 hans Exp $ */
 /*
  * SPX/LCSPX/SPXg/SPXgt accelerated framebuffer driver for NetBSD/VAX
  * Copyright (c) 2005 Blaz Antonic
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spx.c,v 1.2 2009/03/18 16:00:16 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: spx.c,v 1.3 2010/05/09 22:19:46 hans Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -86,7 +86,7 @@
 
 /*
  * off-screen font storage space 
- * 32x16 glyphs, 256 regular and underliend chars
+ * 32x16 glyphs, 256 regular and underlined chars
  */
 #define FONT_STORAGE_START	(spx_xsize * spx_ysize)
 #define FONT_STORAGE_SIZE	(32 * 16 * 256 * 2)
@@ -204,7 +204,7 @@
 static void	spx_cursor(void *, int, int, int);
 static int	spx_mapchar(void *, int, unsigned int *);
 static void	spx_putchar(void *, int, int, u_int, long);
-static void	spx_copycols(void *, int, int, int,int);
+static void	spx_copycols(void *, int, int, int, int);
 static void	spx_erasecols(void *, int, int, int, long);
 static void	spx_copyrows(void *, int, int, int);
 static void	spx_eraserows(void *, int, int, long);
@@ -595,7 +595,8 @@
 		counter--;
 }
 
-int spx_match(device_t parent, cfdata_t match, void *aux)
+int
+spx_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct vsbus_softc *sc = device_private(parent);
 #if 0
@@ -608,31 +609,10 @@
  * add KA46 when/if ever somebody reports SPXg vax_confdata ID on VS 4000/60
  * Ditto for SPX ID on KA42  KA43
  */
-	if (vax_boardtype != VAX_BTYP_49)
+	if ((vax_boardtype != VAX_BTYP_49) ||
+	((vax_confdata  (CONF_LCSPX | CONF_SPXg)) == 0))
 		return 0;
 
-	/* KA49: Identify framebuffer type */
-	switch (vax_confdata  (CONF_LCSPX | CONF_SPXg)) {
-		case CONF_LCSPX:
-			fb_type = FB_IS_SPX;
-			spx_blkcpy_func = SPX_blkcpy;
-			spx_blkset_func = SPX_blkset;
-			spx_putchar_func = SPX_putchar;
-			break;
-		case CONF_SPXg:
-			fb_type = FB_IS_SPXg;
-			spx_blkcpy_func = SPXg_blkcpy;
-			spx_blkset_func = SPXg_blkset;
-			spx_putchar_func = SPXg_putchar;
-			break;
-		case 0: 
-			aprint_error(spx_match: no framebuffer found\n);
-			break;
-		case CONF_LCSPX | CONF_SPXg:
-			panic(spx_match: incorrect FB configuration\n);
-			break;
-	}
-
 /* FIXME add RAMDAC ID code ??? */
 #if 0
 	/* 
@@ -664,6 +644,24 @@
 
 	spx_init_common(self, va);
 
+	/* display FB type based on RAMDAC ID */
+	switch (get_btreg(SPXDAC_REG_ID)  0xff) {
+	case 0x4a:
+		aprint_normal_dev(self,
+			RAMDAC ID: 0x%x, Bt459 (SPX/LCSPX) RAMDAC type\n,
+			get_btreg(SPXDAC_REG_ID)  0xff);
+		break;
+			
+	case 0x4b:
+		aprint_normal_dev(self,
+			RAMDAC ID: 0x%x, Bt460 (SPXg) RAMDAC type\n, 
+			get_btreg(SPXDAC_REG_ID)  0xff);
+		break;
+	default:
+		aprint_error_dev(self, unknown RAMDAC type 0x%x\n,
+			get_btreg(SPXDAC_REG_ID)  0xff);
+	}
+
 	curscr = spx_conscreen;
 	prevscr = curscr;
 
@@ -1071,7 +1069,7 @@
 static void
 spx_free_screen(void *v, void *cookie)
 {
-/* FIXME add something to actually free malloc()ed screen ? */
+/* FIXME add something to actually free malloc()ed screen? */
 }
 
 static int
@@ -1178,7 +1176,7 @@
 	spx_blkset(0, 0, spx_xsize, spx_ysize, SPX_BG_COLOR);
 
 	curscr = spx_conscreen;
-	
+
 	for (i = 0; i  spx_cols * spx_rows; i++)
 		spx_conscreen.ss_image[i].attr =
 			(SPX_BG_COLOR  4) | SPX_FG_COLOR;
@@ -1203,7 +1201,7 @@
 
 	/* Only for VS 4000/90, 90A and 96 with LCSPX or SPXg/gt*/
 	if ((vax_boardtype != VAX_BTYP_49) ||
-	((vax_confdata  (CONF_LCSPX | CONF_SPXg)) != 0))
+	((vax_confdata  (CONF_LCSPX | CONF_SPXg)) == 0))
 		return;
 
 	if (((vax_confdata  8)  (vax_boardtype == VAX_BTYP_49)) ||
@@ -1215,25 +1213,6 @@
 		return; /* Diagnostic console */
 	}
 
-	/* KA49: Identify framebuffer type */
-	switch (vax_confdata  (CONF_LCSPX | CONF_SPXg)) {
-	case CONF_LCSPX:
-		fb_type = FB_IS_SPX;
-		spx_blkcpy_func = SPX_blkcpy;
-		spx_blkset_func = SPX_blkset;
-		break;
-	case CONF_SPXg:
-		fb_type = FB_IS_SPXg;
-		spx_blkcpy_func = SPXg_blkcpy;
-		spx_blkset_func = SPXg_blkset;
-		break;
-	case 0:
-		aprint_error(spxcnprobe: no framebuffer found\n);
-		break;
-	case CONF_LCSPX | CONF_SPXg:
-		panic(spxcnprobe: incorrect FB configuration\n); break;
-	}
-
 	spx_init_common(NULL, NULL);
 
 	cndev-cn_pri = CN_INTERNAL;
@@ -1459,6 +1438,29 @@
 	u_int i, j, 

CVS commit: src/sys/arch/vax/vsa

2010-05-09 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Sun May  9 22:24:44 UTC 2010

Modified Files:
src/sys/arch/vax/vsa: dz_vsbus.c

Log Message:
Make console keyboard work on VAXstation 4000/9x. Seems not to break
anything on other VAXstations (tested on 4000 VLC).


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/vax/vsa/dz_vsbus.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/vax/vsa/dz_vsbus.c
diff -u src/sys/arch/vax/vsa/dz_vsbus.c:1.40 src/sys/arch/vax/vsa/dz_vsbus.c:1.41
--- src/sys/arch/vax/vsa/dz_vsbus.c:1.40	Sat Mar 15 00:57:15 2008
+++ src/sys/arch/vax/vsa/dz_vsbus.c	Sun May  9 22:24:44 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz_vsbus.c,v 1.40 2008/03/15 00:57:15 matt Exp $ */
+/*	$NetBSD: dz_vsbus.c,v 1.41 2010/05/09 22:24:44 hans Exp $ */
 /*
  * Copyright (c) 1998 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dz_vsbus.c,v 1.40 2008/03/15 00:57:15 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: dz_vsbus.c,v 1.41 2010/05/09 22:24:44 hans Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -162,7 +162,7 @@
 	 * due to the nature of how bus_space_* works on VAX, this will
 	 * be perfectly good until everything is converted.
 	 */
-	if (dz_regs == 0) /* This isn't console */ {
+	if (cn_tab-cn_dev != makedev(cdevsw_lookup_major(dz_cdevsw), 0)) {
 		dz_regs = vax_map_physmem(va-va_paddr, 1);
 		consline = -1;
 	} else
@@ -286,6 +286,9 @@
 	dz_regs = iospace;
 	dz = (void *)dz_regs;
 	ioaccess(iospace, ioaddr, 1);
+	dz-csr = 0;/* Disable scanning until initting is done */
+	dz-tcr = (1  minor(cndev-cn_dev));/* Turn on xmitter */
+	dz-csr = 0x20; /* Turn scanning back on */
 }
 
 void



CVS commit: src/sys/dev/dec

2010-05-09 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Sun May  9 22:29:26 UTC 2010

Modified Files:
src/sys/dev/dec: dz.c

Log Message:
The interrupt handler uses the softc, so it's probably a good idea to
initialize it before causing interrupts. Prevents a panic on VAXstation
4000/9x with SPX console.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/dec/dz.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/dec/dz.c
diff -u src/sys/dev/dec/dz.c:1.38 src/sys/dev/dec/dz.c:1.39
--- src/sys/dev/dec/dz.c:1.38	Mon Sep  8 23:36:54 2008
+++ src/sys/dev/dec/dz.c	Sun May  9 22:29:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dz.c,v 1.38 2008/09/08 23:36:54 gmcgarry Exp $	*/
+/*	$NetBSD: dz.c,v 1.39 2010/05/09 22:29:26 hans Exp $	*/
 /*
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dz.c,v 1.38 2008/09/08 23:36:54 gmcgarry Exp $);
+__KERNEL_RCSID(0, $NetBSD: dz.c,v 1.39 2010/05/09 22:29:26 hans Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -204,16 +204,7 @@
 {
 	int n;
 
-	sc-sc_rxint = sc-sc_brk = 0;
-	sc-sc_consline = consline;
-
-	sc-sc_dr.dr_tcrw = sc-sc_dr.dr_tcr;
-	dz_write2(sc, sc-sc_dr.dr_csr, DZ_CSR_MSE | DZ_CSR_RXIE | DZ_CSR_TXIE);
-	dz_write1(sc, sc-sc_dr.dr_dtr, 0);
-	dz_write1(sc, sc-sc_dr.dr_break, 0);
-	DELAY(1);
-
-	/* Initialize our softc structure. Should be done in open? */
+	/* Initialize our softc structure. */
 
 	for (n = 0; n  sc-sc_type; n++) {
 		sc-sc_dz[n].dz_sc = sc;
@@ -231,6 +222,15 @@
 	cn_set_magic(\047\001); /* default magic is BREAK */
   /* VAX will change it in MD code */
 
+	sc-sc_rxint = sc-sc_brk = 0;
+	sc-sc_consline = consline;
+
+	sc-sc_dr.dr_tcrw = sc-sc_dr.dr_tcr;
+	dz_write2(sc, sc-sc_dr.dr_csr, DZ_CSR_MSE | DZ_CSR_RXIE | DZ_CSR_TXIE);
+	dz_write1(sc, sc-sc_dr.dr_dtr, 0);
+	dz_write1(sc, sc-sc_dr.dr_break, 0);
+	DELAY(1);
+
 	/* Alas no interrupt on modem bit changes, so we manually scan */
 	if (dz_timer == 0) {
 		dz_timer = 1;



CVS commit: src/tools/gdb

2010-05-08 Thread Hans Rosenfeld
Module Name:src
Committed By:   hans
Date:   Sat May  8 23:18:44 UTC 2010

Modified Files:
src/tools/gdb: Makefile

Log Message:
Fix tools build on Solaris with MKCROSSGDB=YES.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tools/gdb/Makefile

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

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.16 src/tools/gdb/Makefile:1.17
--- src/tools/gdb/Makefile:1.16	Wed Dec 23 20:17:13 2009
+++ src/tools/gdb/Makefile	Sat May  8 23:18:44 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.16 2009/12/23 20:17:13 mrg Exp $
+#	$NetBSD: Makefile,v 1.17 2010/05/08 23:18:44 hans Exp $
 
 .include bsd.own.mk
 
@@ -33,6 +33,15 @@
 	bash_cv_func_strcoll_broken=no \
 	bash_cv_must_reinstall_sighandlers=no
 
+# Recent versions of Solaris have ncurses, but they hide the lib in an
+# odd directory. Prevent configure from finding the ncurses headers,
+# Solaris curses is sufficient.
+.if ${BUILD_OSTYPE} == SunOS
+CONFIGURE_ENV+=	ac_cv_header_ncurses_h=no \
+		ac_cv_header_ncurses_ncurses_h=no \
+		ac_cv_header_ncurses_term_h=no
+.endif
+
 # Disable sim unless it's known to work (configure's default is to
 # enable sim if supported).
 CONFIGURE_ARGS_SIM=