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

2010-05-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed May 12 06:11:31 UTC 2010

Modified Files:
src/sys/arch/powerpc/pic: intr.c

Log Message:
make this work again


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/powerpc/pic/intr.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/powerpc/pic/intr.c
diff -u src/sys/arch/powerpc/pic/intr.c:1.8 src/sys/arch/powerpc/pic/intr.c:1.9
--- src/sys/arch/powerpc/pic/intr.c:1.8	Sat Apr 24 09:39:57 2010
+++ src/sys/arch/powerpc/pic/intr.c	Wed May 12 06:11:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.8 2010/04/24 09:39:57 kiyohara Exp $ */
+/*	$NetBSD: intr.c,v 1.9 2010/05/12 06:11:31 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.8 2010/04/24 09:39:57 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.9 2010/05/12 06:11:31 macallan Exp $);
 
 #include opt_multiprocessor.h
 
@@ -682,7 +682,7 @@
 	__asm volatile(sync; eieio);	/* don't reorder */
 
 	ocpl = ci-ci_cpl;
-	ci-ci_cpl = ncpl;
+	ci-ci_cpl = ocpl | ncpl;
 	__asm volatile(sync; eieio);	/* reorder protect */
 	return ocpl;
 }



CVS commit: src/sys/kern

2010-05-12 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Wed May 12 08:11:16 UTC 2010

Modified Files:
src/sys/kern: subr_pool.c

Log Message:
pool_{cache_}get: improve previous diagnostic by checking for panicstr,
so it wont trigger the assert while trying to dump core on crash.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/kern/subr_pool.c

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

Modified files:

Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.184 src/sys/kern/subr_pool.c:1.185
--- src/sys/kern/subr_pool.c:1.184	Wed May 12 03:43:46 2010
+++ src/sys/kern/subr_pool.c	Wed May 12 08:11:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.184 2010/05/12 03:43:46 rmind Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.185 2010/05/12 08:11:16 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_pool.c,v 1.184 2010/05/12 03:43:46 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_pool.c,v 1.185 2010/05/12 08:11:16 rmind Exp $);
 
 #include opt_ddb.h
 #include opt_pool.h
@@ -992,7 +992,8 @@
 	if (pp-pr_itemsperpage == 0)
 		panic(pool_get: pool '%s': pr_itemsperpage is zero, 
 		pool not initialized?, pp-pr_wchan);
-	if ((cpu_intr_p() || cpu_softintr_p())  pp-pr_ipl == IPL_NONE)
+	if ((cpu_intr_p() || cpu_softintr_p())  pp-pr_ipl == IPL_NONE 
+	!cold  panicstr == NULL)
 		panic(pool '%s' is IPL_NONE, but called from 
 		interrupt context\n, pp-pr_wchan);
 #endif
@@ -2529,7 +2530,7 @@
 	int s;
 
 	KASSERTMSG((!cpu_intr_p()  !cpu_softintr_p()) ||
-	(pc-pc_pool.pr_ipl != IPL_NONE || cold),
+	(pc-pc_pool.pr_ipl != IPL_NONE || cold || panicstr != NULL),
 	(pool '%s' is IPL_NONE, but called from interrupt context\n,
 	pc-pc_pool.pr_wchan));
 



CVS commit: src/sys/dev/ic

2010-05-12 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 12 10:25:23 UTC 2010

Modified Files:
src/sys/dev/ic: gem.c

Log Message:
Use callout_halt() instead of callout_stop() - otherwise gem_detach() might
be too fast and run callout_destroy() while another cpu is still busy
in the callout.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ic/gem.c

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

Modified files:

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.94 src/sys/dev/ic/gem.c:1.95
--- src/sys/dev/ic/gem.c:1.94	Mon Apr  5 07:19:34 2010
+++ src/sys/dev/ic/gem.c	Wed May 12 10:25:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.94 2010/04/05 07:19:34 joerg Exp $ */
+/*	$NetBSD: gem.c,v 1.95 2010/05/12 10:25:23 martin Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.94 2010/04/05 07:19:34 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: gem.c,v 1.95 2010/05/12 10:25:23 martin Exp $);
 
 #include opt_inet.h
 
@@ -714,7 +714,7 @@
 
 	DPRINTF(sc, (%s: gem_stop\n, device_xname(sc-sc_dev)));
 
-	callout_stop(sc-sc_tick_ch);
+	callout_halt(sc-sc_tick_ch, NULL);
 	if ((sc-sc_flags  (GEM_SERDES | GEM_SERIAL)) != 0)
 		gem_pcs_stop(sc, disable);
 	else



CVS commit: src/sys/arch/sparc64/conf

2010-05-12 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Wed May 12 12:26:00 UTC 2010

Modified Files:
src/sys/arch/sparc64/conf: GENERIC

Log Message:
Remove obsolete comment about a data corruption on IDE controllers
in Blade 100/Netra X1.

Workaround for a data corruption was commited as rev. 1.16 of
src/sys/dev/pci/aceride.c in 2005.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/sparc64/conf/GENERIC

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/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.126 src/sys/arch/sparc64/conf/GENERIC:1.127
--- src/sys/arch/sparc64/conf/GENERIC:1.126	Sat May  8 22:16:30 2010
+++ src/sys/arch/sparc64/conf/GENERIC	Wed May 12 12:25:59 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.126 2010/05/08 22:16:30 mrg Exp $
+# $NetBSD: GENERIC,v 1.127 2010/05/12 12:25:59 nakayama Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.126 $
+#ident 		GENERIC-$Revision: 1.127 $
 
 maxusers	64
 
@@ -392,10 +392,7 @@
 # 0x0fac means 'use PIO mode 4, DMA mode 2, disable UltraDMA'.
 # (0xc=1100, 0xa=1010, 0xf=)
 # 0x means use whatever the drive claims to support.
-
-## Disable UDMA 4 which causes data corruption on the Acer Labs
-## chipset on Sun Blade 100 and Netra X1 machines.
-wd* at atabus? drive ? flags 0x
+wd*	at atabus? drive ? flags 0x
 
 cd*	at atapibus? drive ? flags 0x	# ATAPI CD-ROM drives
 sd*	at atapibus? drive ? flags 0x	# ATAPI disk drives



CVS commit: src/sys/dev/pci

2010-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 12 12:26:16 UTC 2010

Modified Files:
src/sys/dev/pci: if_iwn.c pcidevs

Log Message:
Use device names from the OpenBSD iwn driver, adding and modifying device
names as needed. From Sverre Froyen


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/if_iwn.c
cvs rdiff -u -r1.1030 -r1.1031 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.44 src/sys/dev/pci/if_iwn.c:1.45
--- src/sys/dev/pci/if_iwn.c:1.44	Sat May  1 22:06:15 2010
+++ src/sys/dev/pci/if_iwn.c	Wed May 12 08:26:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.44 2010/05/02 02:06:15 christos Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.45 2010/05/12 12:26:16 christos Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.88 2010/04/10 08:37:36 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.44 2010/05/02 02:06:15 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.45 2010/05/12 12:26:16 christos Exp $);
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -76,18 +76,6 @@
 #include dev/pci/if_iwnvar.h
 
 static const pci_product_id_t iwn_devices[] = {
-/* XXX From old NetBSD iwn driver (used by pcidevs) */
-	PCI_PRODUCT_INTEL_PRO_WL_4965AGN_1,
-	PCI_PRODUCT_INTEL_PRO_WL_4965AGN_2,
-	PCI_PRODUCT_INTEL_PRO_WL_5100AGN_1,
-	PCI_PRODUCT_INTEL_PRO_WL_5100AGN_2,
-	PCI_PRODUCT_INTEL_PRO_WL_5300AGN_1,
-	PCI_PRODUCT_INTEL_PRO_WL_5300AGN_2,
-	PCI_PRODUCT_INTEL_PRO_WL_5350AGN_1,
-	PCI_PRODUCT_INTEL_PRO_WL_5350AGN_2,
-	PCI_PRODUCT_INTEL_WIFI_LINK_6000_3X3_2,
-#if 0
-/* XXX From new OpenBSD iwn driver (not in pcidevs) */
 	PCI_PRODUCT_INTEL_WIFI_LINK_4965_1,
 	PCI_PRODUCT_INTEL_WIFI_LINK_4965_2,
 	PCI_PRODUCT_INTEL_WIFI_LINK_5100_1,
@@ -101,13 +89,13 @@
 	PCI_PRODUCT_INTEL_WIFI_LINK_1000_1,
 	PCI_PRODUCT_INTEL_WIFI_LINK_1000_2,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6000_3X3_1,
+	PCI_PRODUCT_INTEL_WIFI_LINK_6000_3X3_2,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_1,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_2,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6050_2X2_1,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6050_2X2_2,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6005_2X2_1,
 	PCI_PRODUCT_INTEL_WIFI_LINK_6005_2X2_2,
-#endif
 };
 
 /*
@@ -713,15 +701,12 @@
 		sc-limits = iwn6000_sensitivity_limits;
 		sc-fwname = iwlwifi-6000-4.ucode;
 		switch (pid) {
-/* XXX not yet defined for NetBSD (not in pcidevs) */
-#ifdef PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_1
 		case PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_1:
 		case PCI_PRODUCT_INTEL_WIFI_LINK_6000_IPA_2:
 			sc-sc_flags |= IWN_FLAG_INTERNAL_PA;
 			sc-txchainmask = IWN_ANT_BC;
 			sc-rxchainmask = IWN_ANT_BC;
 			break;
-#endif
 		default:
 			sc-txchainmask = IWN_ANT_ABC;
 			sc-rxchainmask = IWN_ANT_ABC;

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1030 src/sys/dev/pci/pcidevs:1.1031
--- src/sys/dev/pci/pcidevs:1.1030	Mon May 10 02:38:45 2010
+++ src/sys/dev/pci/pcidevs	Wed May 12 08:26:16 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1030 2010/05/10 06:38:45 matt Exp $
+$NetBSD: pcidevs,v 1.1031 2010/05/12 12:26:16 christos Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -2230,6 +2230,12 @@
 product INTEL PCMC		0x04a3	82434LX/NX PCI, Cache and Memory Controller (PCMC)
 product INTEL GDT_RAID1		0x0600	GDT RAID
 product INTEL GDT_RAID2		0x061f	GDT RAID
+product INTEL WIFI_LINK_6005_2X2_1	0x0082	Centrino Advanced-N 6205
+product INTEL WIFI_LINK_1000_1	0x0083	WiFi Link 1000
+product INTEL WIFI_LINK_1000_2	0x0084	WiFi Link 1000
+product INTEL WIFI_LINK_6005_2X2_2	0x0085	Centrino Advanced-N 6205
+product INTEL WIFI_LINK_6050_2X2_1	0x0087	Centrino Advanced-N 6250
+product INTEL WIFI_LINK_6050_2X2_2	0x0089	Centrino Advanced-N 6250
 product INTEL 80960RM		0x0962	i960 RM PCI-PCI
 product INTEL 80960RN		0x0964	i960 RN PCI-PCI
 product INTEL 82542		0x1000	i82542 Gigabit Ethernet
@@ -2784,15 +2790,20 @@
 product INTEL PRO_WL_2915ABG_1	0x4223	PRO/Wireless LAN 2915ABG Mini-PCI Adapter
 product INTEL PRO_WL_2915ABG_2	0x4224	PRO/Wireless LAN 2915ABG Mini-PCI Adapter
 product INTEL PRO_WL_3945ABG_2	0x4227	PRO/Wireless LAN 3945ABG Mini-PCI Adapter
-product INTEL PRO_WL_4965AGN_1	0x4229  PRO/Wireless LAN 4965AGN Mini-PCI Adapter
-product INTEL PRO_WL_4965AGN_2	0x4230  PRO/Wireless LAN 4965AGN Mini-PCI Adapter
-product INTEL PRO_WL_5100AGN_1	0x4232	Pro/Wireless LAN 5100AGN Mini-PCI Adapter
-product INTEL PRO_WL_5300AGN_1	0x4235	Pro/Wireless LAN 5300AGN Mini-PCI Adapter
-product INTEL PRO_WL_5300AGN_2	0x4236	Pro/Wireless LAN 5300AGN Mini-PCI Adapter
-product INTEL PRO_WL_5100AGN_2	0x4237	Pro/Wireless LAN 5100AGN Mini-PCI Adapter
-product INTEL WIFI_LINK_6000_3X3_2	0x4238	Pro/Wireless LAN 6300AGN Mini-PCI Adapter
-product INTEL PRO_WL_5350AGN_1	0x423a	Pro/Wireless LAN 5350AGN 

CVS commit: src/distrib/sets/lists/comp

2010-05-12 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Wed May 12 13:15:00 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: ad.arm md.shark

Log Message:
move MKDEBUG entries for libs from md.shark to ad.arm to match ../base/ad.arm


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/distrib/sets/lists/comp/ad.arm
cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/comp/md.shark

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

Modified files:

Index: src/distrib/sets/lists/comp/ad.arm
diff -u src/distrib/sets/lists/comp/ad.arm:1.34 src/distrib/sets/lists/comp/ad.arm:1.35
--- src/distrib/sets/lists/comp/ad.arm:1.34	Sun Mar 14 09:52:00 2010
+++ src/distrib/sets/lists/comp/ad.arm	Wed May 12 13:15:00 2010
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.34 2010/03/14 09:52:00 mrg Exp $
+# $NetBSD: ad.arm,v 1.35 2010/05/12 13:15:00 lukem Exp $
 ./usr/include/armcomp-c-include
 ./usr/include/arm/ansi.h			comp-c-include
 ./usr/include/arm/aout_machdep.h		comp-c-include
@@ -92,6 +92,8 @@
 ./usr/lib/libpmc_pic.acomp-c-piclib
 ./usr/libdata/debug/sbin/ldconfig.debug		comp-sysutil-debug	debug,pic
 ./usr/libdata/debug/usr/bin/fdformat.debug	comp-util-debug		debug
+./usr/libdata/debug/usr/lib/libarm.so.0.0.debug	comp-sys-debug		debug,pic
+./usr/libdata/debug/usr/lib/libpmc.so.1.0.debug	comp-sys-debug		debug,pic
 ./usr/libdata/lint/llib-larm.ln			comp-c-lintlib		lint
 ./usr/libdata/lint/llib-larm32.ln		comp-obsolete		obsolete
 ./usr/libdata/lint/llib-lpmc.ln			comp-c-lintlib		lint

Index: src/distrib/sets/lists/comp/md.shark
diff -u src/distrib/sets/lists/comp/md.shark:1.14 src/distrib/sets/lists/comp/md.shark:1.15
--- src/distrib/sets/lists/comp/md.shark:1.14	Sat May  8 08:16:41 2010
+++ src/distrib/sets/lists/comp/md.shark	Wed May 12 13:15:00 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.shark,v 1.14 2010/05/08 08:16:41 jmmv Exp $
+# $NetBSD: md.shark,v 1.15 2010/05/12 13:15:00 lukem Exp $
 ./usr/include/sharkcomp-c-include
 ./usr/include/shark/ansi.h			comp-c-include
 ./usr/include/shark/aout_machdep.h		comp-c-include
@@ -50,7 +50,5 @@
 ./usr/include/shark/vmparam.h			comp-c-include
 ./usr/include/shark/wchar_limits.h		comp-c-include
 ./usr/include/ieeefp.hcomp-c-include
-./usr/libdata/debug/usr/lib/libarm.so.0.0.debug	comp-sys-debug		debug,pic
-./usr/libdata/debug/usr/lib/libpmc.so.1.0.debug	comp-sys-debug		debug,pic
 ./usr/libdata/debug/sbin/ldconfig.debug		comp-sysutil-debug	debug,pic
 ./usr/libdata/debug/usr/sbin/ofctl.debug	comp-sysutil-debug	debug



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

2010-05-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed May 12 14:43:48 UTC 2010

Modified Files:
src/sys/arch/vax/vax: genassym.cf

Log Message:
Add PSL_HIGHIPL for recent subr.S change


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/vax/vax/genassym.cf

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/vax/genassym.cf
diff -u src/sys/arch/vax/vax/genassym.cf:1.45 src/sys/arch/vax/vax/genassym.cf:1.46
--- src/sys/arch/vax/vax/genassym.cf:1.45	Sat Mar 20 23:31:30 2010
+++ src/sys/arch/vax/vax/genassym.cf	Wed May 12 14:43:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.45 2010/03/20 23:31:30 chs Exp $
+#	$NetBSD: genassym.cf,v 1.46 2010/05/12 14:43:48 matt Exp $
 #
 # Copyright (c) 1997 Ludd, University of Lule}, Sweden.
 # All rights reserved.
@@ -163,6 +163,7 @@
 define	VC_DIAGTIMM	offsetof(struct vs_cpu, vc_diagtimm)
 
 define	PSL_IS		PSL_IS
+define	PSL_HIGHIPL	PSL_HIGHIPL
 
 define	MTX_OWNER	offsetof(struct kmutex, mtx_owner)
 define	MTX_LOCK	offsetof(struct kmutex, mtx_lock)



CVS commit: src/share/man/man9

2010-05-12 Thread Adam Hamsik
Module Name:src
Committed By:   haad
Date:   Wed May 12 15:54:47 UTC 2010

Modified Files:
src/share/man/man9: kthread.9

Log Message:
Document kthread_join in kthread(9).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/kthread.9

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

Modified files:

Index: src/share/man/man9/kthread.9
diff -u src/share/man/man9/kthread.9:1.20 src/share/man/man9/kthread.9:1.21
--- src/share/man/man9/kthread.9:1.20	Mon Aug  3 23:29:19 2009
+++ src/share/man/man9/kthread.9	Wed May 12 15:54:47 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: kthread.9,v 1.20 2009/08/03 23:29:19 rmind Exp $
+.\ $NetBSD: kthread.9,v 1.21 2010/05/12 15:54:47 haad Exp $
 .\
 .\ Copyright (c) 2000, 2007, 2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -34,6 +34,7 @@
 .Nm kthread_create ,
 .Nm kthread_destroy ,
 .Nm kthread_exit
+.Nm kthread_join
 .Nd kernel threads
 .Sh SYNOPSIS
 .In sys/kthread.h
@@ -108,6 +109,8 @@
 .Fa ci ,
 meaning that it will only ever execute on that CPU.
 By default, the threads are free to execute on any CPU in the system.
+.Dv KTHREAD_JOINABLE
+Request creation of joinable kthread.
 .It Fa func
 A function to be called when the thread begins executing.
 This function must not return.
@@ -139,6 +142,8 @@
 .It Fn kthread_exit ecode
 Exit from a kernel thread.
 Must only be called by a kernel thread.
+.It Fn kthread_join l
+Suspend execution of running LWP untils the target kthread terminates.
 .El
 .Sh RETURN VALUES
 Upon successful completion,



CVS commit: src/sys/dev/acpi

2010-05-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 12 15:59:52 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_power.c

Log Message:
Initial pass for issues observed by dyoung@ on HP Pavilion N3270. In this
laptop there is a PNP0C0B (ACPI fan) with the following properties:

_PSC : Power state for D3 (alone).
_PR0 : Power resources for D0.
_PSx : Power state switch for D0 and D3.

Thus, it is impossible to get or set the D3 power state via power resources
alone; there is only a single PowerResource() and it is for D0.

To tackle this:

  1. Evaluate the direct _PSC control method if and only if there is no
 given _PRx. The order is important; it is known that some other
 systems implement the _PSC method (like _STA) incorrectly.

  2. If no _PRx is available (and thus no _ON or _OFF), do not error out.
 Instead, if we have AE_NOT_FOUND, continue to evaluate the power state
 switch method, _PSx, which (on this laptop) should alone suffice for
 the D0 - D3 transition.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/acpi_power.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/acpi/acpi_power.c
diff -u src/sys/dev/acpi/acpi_power.c:1.11 src/sys/dev/acpi/acpi_power.c:1.12
--- src/sys/dev/acpi/acpi_power.c:1.11	Tue Apr 27 05:34:14 2010
+++ src/sys/dev/acpi/acpi_power.c	Wed May 12 15:59:52 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_power.c,v 1.11 2010/04/27 05:34:14 jruoho Exp $ */
+/* $NetBSD: acpi_power.c,v 1.12 2010/05/12 15:59:52 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_power.c,v 1.11 2010/04/27 05:34:14 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_power.c,v 1.12 2010/05/12 15:59:52 jruoho Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -104,10 +104,7 @@
 static struct acpi_power_res	*acpi_power_res_init(ACPI_HANDLE);
 static struct acpi_power_res	*acpi_power_res_get(ACPI_HANDLE);
 
-#if 0
 static ACPI_STATUS	 acpi_power_get_direct(struct acpi_devnode *);
-#endif
-
 static ACPI_STATUS	 acpi_power_get_indirect(struct acpi_devnode *);
 static ACPI_STATUS	 acpi_power_switch(struct acpi_devnode *,
 		   int, bool);
@@ -267,9 +264,18 @@
 		goto fail;
 	}
 
+	/*
+	 * Because the _PSC control method, like _STA,
+	 * is known to be implemented incorrectly in
+	 * many systems, we first try to retrieve the
+	 * power state indirectly via power resources.
+	 */
 	rv = acpi_power_get_indirect(ad);
 
 	if (ACPI_FAILURE(rv))
+		rv = acpi_power_get_direct(ad);
+
+	if (ACPI_FAILURE(rv))
 		goto fail;
 
 	KASSERT(ad-ad_state != ACPI_STATE_ERROR);
@@ -296,11 +302,6 @@
 	return false;
 }
 
-#if 0
-/*
- * Unfortunately, comparable to _STA, there are systems
- * where the convenient _PSC is implemented incorrectly.
- */
 static ACPI_STATUS
 acpi_power_get_direct(struct acpi_devnode *ad)
 {
@@ -315,7 +316,6 @@
 
 	return rv;
 }
-#endif
 
 static ACPI_STATUS
 acpi_power_get_indirect(struct acpi_devnode *ad)
@@ -410,27 +410,25 @@
 	}
 
 	/*
-	 * We first sweep through the resources required
-	 * for the target state, turning things on and
-	 * building references. After this we dereference
-	 * the resources required for the current state,
+	 * We first sweep through the resources required for the target
+	 * state, turning things on and building references. After this
+	 * we dereference the resources required for the current state,
 	 * turning the resources off as we go.
 	 */
 	rv = acpi_power_switch(ad, state, true);
 
-	if (ACPI_FAILURE(rv))
+	if (ACPI_FAILURE(rv)  rv != AE_CTRL_CONTINUE)
 		goto fail;
 
 	rv = acpi_power_switch(ad, ad-ad_state, false);
 
-	if (ACPI_FAILURE(rv))
+	if (ACPI_FAILURE(rv)  rv != AE_CTRL_CONTINUE)
 		goto fail;
 
-	ad-ad_state = state;
-
 	/*
-	 * Last but not least, invoke the power
-	 * state switch method, if available.
+	 * Last but not least, invoke the power state switch method,
+	 * if available. Because some systems use only _PSx for the
+	 * power state transitions, we do this even if there is no _PRx.
 	 */
 	(void)snprintf(path, sizeof(path), _PS%d, state);
 	(void)AcpiEvaluateObject(ad-ad_handle, path, NULL, NULL);
@@ -438,6 +436,8 @@
 	aprint_debug_dev(ad-ad_root, %s turned from 
 	D%d to D%d\n, ad-ad_name, old, state);
 
+	ad-ad_state = state;
+
 	return true;
 
 fail:
@@ -472,13 +472,16 @@
 	pkg = acpi_power_pkg_get(ad-ad_handle, state);
 
 	if (pkg == NULL)
-		return AE_NOT_EXIST;
+		return AE_CTRL_CONTINUE;
 
 	if (on != false)
 		rv = acpi_foreach_package_object(pkg, acpi_power_res_on, ad);
 	else
 		rv = acpi_foreach_package_object(pkg, acpi_power_res_off, ad);
 
+	if (rv == AE_CTRL_CONTINUE)
+		rv = AE_ERROR;
+
 	ACPI_FREE(pkg);
 
 	return rv;



CVS commit: src/sys/dev/acpi

2010-05-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 12 16:11:05 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi.c

Log Message:
When scanning the device capabilities (power, wake-up, etc.),
include all device nodes, regardless of the status of the device.

XXX: It is known that some systems implement the _STA method incorrectly.
 If needed in the future, attachment based on the values from this
 method may need revisiting. Same goes for ACPI_ACTIVATE_DEV.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/dev/acpi/acpi.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/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.194 src/sys/dev/acpi/acpi.c:1.195
--- src/sys/dev/acpi/acpi.c:1.194	Tue Apr 27 08:36:06 2010
+++ src/sys/dev/acpi/acpi.c	Wed May 12 16:11:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.194 2010/04/27 08:36:06 jruoho Exp $	*/
+/*	$NetBSD: acpi.c,v 1.195 2010/05/12 16:11:05 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.194 2010/04/27 08:36:06 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi.c,v 1.195 2010/05/12 16:11:05 jruoho Exp $);
 
 #include opt_acpi.h
 #include opt_pcifixup.h
@@ -984,19 +984,12 @@
 acpi_rescan_capabilities(struct acpi_softc *sc)
 {
 	struct acpi_devnode *ad;
-	ACPI_DEVICE_INFO *di;
 	ACPI_HANDLE tmp;
 	ACPI_STATUS rv;
 
 	SIMPLEQ_FOREACH(ad, sc-ad_head, ad_list) {
 
-		di = ad-ad_devinfo;
-
-		if (di-Type != ACPI_TYPE_DEVICE)
-			continue;
-
-		if ((di-Valid  ACPI_VALID_STA) != 0 
-		(di-CurrentStatus  ACPI_STA_OK) != ACPI_STA_OK)
+		if (ad-ad_devinfo-Type != ACPI_TYPE_DEVICE)
 			continue;
 
 		/*



CVS commit: src/sys/arch/hpcsh/dev/hd64461

2010-05-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed May 12 16:41:08 UTC 2010

Modified Files:
src/sys/arch/hpcsh/dev/hd64461: hd64461uart.c

Log Message:
Fix arg of intr_establish().
  comintr() expects struct com_softc* for arg.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hpcsh/dev/hd64461/hd64461uart.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/hpcsh/dev/hd64461/hd64461uart.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.22 src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.23
--- src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.22	Mon Apr 28 20:23:22 2008
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c	Wed May 12 16:41:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461uart.c,v 1.22 2008/04/28 20:23:22 martin Exp $	*/
+/*	$NetBSD: hd64461uart.c,v 1.23 2010/05/12 16:41:08 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hd64461uart.c,v 1.22 2008/04/28 20:23:22 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: hd64461uart.c,v 1.23 2010/05/12 16:41:08 kiyohara Exp $);
 
 #include opt_kgdb.h
 
@@ -188,7 +188,7 @@
 	com_attach_subr(csc);
 
 	hd6446x_intr_establish(HD64461_INTC_UART, IST_LEVEL, IPL_TTY,
-	comintr, self);
+	comintr, csc);
 }
 
 STATIC void



CVS commit: src/sys/rump/librump/rumpkern

2010-05-12 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed May 12 16:48:21 UTC 2010

Modified Files:
src/sys/rump/librump/rumpkern: intr.c

Log Message:
fix inversion: advance clock on cpu0, not the complement of cpu0


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/rump/librump/rumpkern/intr.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/rump/librump/rumpkern/intr.c
diff -u src/sys/rump/librump/rumpkern/intr.c:1.26 src/sys/rump/librump/rumpkern/intr.c:1.27
--- src/sys/rump/librump/rumpkern/intr.c:1.26	Wed Apr 28 00:32:30 2010
+++ src/sys/rump/librump/rumpkern/intr.c	Wed May 12 16:48:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.26 2010/04/28 00:32:30 pooka Exp $	*/
+/*	$NetBSD: intr.c,v 1.27 2010/05/12 16:48:21 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.26 2010/04/28 00:32:30 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.27 2010/05/12 16:48:21 pooka Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -128,7 +128,7 @@
 		if (!CPU_IS_PRIMARY(curcpu()))
 			continue;
 #else
-		if (curcpu()-ci_index == 0)
+		if (curcpu()-ci_index != 0)
 			continue;
 #endif
 



CVS commit: src/sys/dev/acpi/acpica

2010-05-12 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Wed May 12 17:03:11 UTC 2010

Modified Files:
src/sys/dev/acpi/acpica: OsdSchedule.c

Log Message:
Print a warning if AcpiOsSleep() is called with a value larger than two
seconds. It is known that there are systems in the field that pass bogus AML
values to the Sleep() operation code, possibly requesting delays that could
be measured in days.

Discussed with jmcne...@.

XXX: While the used mstohz(9) is documented to round to one second if the
 passed value is larger than 131072 ms, we may still need to force a
 sensible upper limit if this warning starts to appear.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/acpi/acpica/OsdSchedule.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/acpi/acpica/OsdSchedule.c
diff -u src/sys/dev/acpi/acpica/OsdSchedule.c:1.12 src/sys/dev/acpi/acpica/OsdSchedule.c:1.13
--- src/sys/dev/acpi/acpica/OsdSchedule.c:1.12	Sun Aug 23 15:16:16 2009
+++ src/sys/dev/acpi/acpica/OsdSchedule.c	Wed May 12 17:03:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $	*/
+/*	$NetBSD: OsdSchedule.c,v 1.13 2010/05/12 17:03:11 jruoho Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: OsdSchedule.c,v 1.13 2010/05/12 17:03:11 jruoho Exp $);
 
 #include sys/param.h
 #include sys/malloc.h
@@ -140,6 +140,13 @@
 void
 AcpiOsSleep(ACPI_INTEGER Milliseconds)
 {
+	static bool once = false;
+
+	if (Milliseconds  2000  once != true) {
+		aprint_error(acpi0: WARNING: long Sleep()\n);
+		once = true;
+	}
+
 	if (cold || doing_shutdown || acpi_suspended)
 		DELAY(Milliseconds * 1000);
 	else {



CVS commit: src/sbin/route

2010-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 12 17:56:13 UTC 2010

Modified Files:
src/sbin/route: keywords.c keywords.h route.8 route.c

Log Message:
PR/40455: Mihai Chelaru: Add noreject noblackhole options


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/route/keywords.c
cvs rdiff -u -r1.9 -r1.10 src/sbin/route/keywords.h
cvs rdiff -u -r1.40 -r1.41 src/sbin/route/route.8
cvs rdiff -u -r1.119 -r1.120 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/route/keywords.c
diff -u src/sbin/route/keywords.c:1.6 src/sbin/route/keywords.c:1.7
--- src/sbin/route/keywords.c:1.6	Sun Aug  6 13:44:56 2006
+++ src/sbin/route/keywords.c	Wed May 12 13:56:13 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: keywords.c,v 1.6 2006/08/06 17:44:56 dyoung Exp $ */
+/* $NetBSD: keywords.c,v 1.7 2010/05/12 17:56:13 christos Exp $ */
 
 /* WARNING!  This file was generated by keywords.sh  */
 
@@ -57,6 +57,8 @@
 	{xns, K_XNS},
 	{xresolve, K_XRESOLVE},
 	{flushall, K_FLUSHALL},
+	{noblackhole, K_NOBLACKHOLE},
+	{noreject, K_NOREJECT},
 	{0, 0}
 };
 

Index: src/sbin/route/keywords.h
diff -u src/sbin/route/keywords.h:1.9 src/sbin/route/keywords.h:1.10
--- src/sbin/route/keywords.h:1.9	Sun Aug  6 13:44:56 2006
+++ src/sbin/route/keywords.h	Wed May 12 13:56:13 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: keywords.h,v 1.9 2006/08/06 17:44:56 dyoung Exp $ */
+/* $NetBSD: keywords.h,v 1.10 2010/05/12 17:56:13 christos Exp $ */
 
 /* WARNING!  This file was generated by keywords.sh  */
 
@@ -59,3 +59,5 @@
 #define	K_FLUSHALL	49
 #define	K_NOCLONED	50
 #define	K_NOCLONING	51
+#define	K_NOBLACKHOLE	52
+#define	K_NOREJECT	53

Index: src/sbin/route/route.8
diff -u src/sbin/route/route.8:1.40 src/sbin/route/route.8:1.41
--- src/sbin/route/route.8:1.40	Sun Aug  6 19:38:13 2006
+++ src/sbin/route/route.8	Wed May 12 13:56:13 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: route.8,v 1.40 2006/08/06 23:38:13 wiz Exp $
+.\	$NetBSD: route.8,v 1.41 2010/05/12 17:56:13 christos Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -267,19 +267,21 @@
 These flags may be set (or sometimes cleared)
 by indicating the following corresponding modifiers:
 .Bd -literal
--cloningRTF_CLONING- generates a new route on use
--nocloning ~RTF_CLONING- stop generating new routes on use
--cloned RTF_CLONED - cloned route generated by RTF_CLONING
--nocloned  ~RTF_CLONED - prevent removal with RTF_CLONING parent
--xresolve   RTF_XRESOLVE   - emit mesg on use (for external lookup)
--iface ~RTF_GATEWAY- destination is directly reachable
--static RTF_STATIC - manually added route
--nostatic  ~RTF_STATIC - pretend route added by kernel or daemon
--reject RTF_REJECT - emit an ICMP unreachable when matched
--blackhole  RTF_BLACKHOLE  - silently discard pkts (during updates)
--proto1 RTF_PROTO1 - set protocol specific routing flag #1
--proto2 RTF_PROTO2 - set protocol specific routing flag #2
--llinfo RTF_LLINFO - validly translates proto addr to link addr
+-cloning  RTF_CLONING- generates a new route on use
+-nocloning   ~RTF_CLONING- stop generating new routes on use
+-cloned   RTF_CLONED - cloned route generated by RTF_CLONING
+-nocloned~RTF_CLONED - prevent removal with RTF_CLONING parent
+-xresolve RTF_XRESOLVE   - emit mesg on use (for external lookup)
+-iface   ~RTF_GATEWAY- destination is directly reachable
+-static   RTF_STATIC - manually added route
+-nostatic~RTF_STATIC - pretend route added by kernel or daemon
+-reject   RTF_REJECT - emit an ICMP unreachable when matched
+-noreject~RTF_REJECT - clear reject flag
+-blackholeRTF_BLACKHOLE  - silently discard pkts (during updates)
+-noblackhole ~RTF_BLACKHOLE  - clear blackhole flag
+-proto1   RTF_PROTO1 - set protocol specific routing flag #1
+-proto2   RTF_PROTO2 - set protocol specific routing flag #2
+-llinfo   RTF_LLINFO - validly translates proto addr to link addr
 .Ed
 .Pp
 The optional modifiers

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.119 src/sbin/route/route.c:1.120
--- src/sbin/route/route.c:1.119	Sun Dec 28 15:12:31 2008
+++ src/sbin/route/route.c	Wed May 12 13:56:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.119 2008/12/28 20:12:31 christos Exp $	*/
+/*	$NetBSD: route.c,v 1.120 2010/05/12 17:56:13 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = @(#)route.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: route.c,v 1.119 2008/12/28 20:12:31 christos Exp $);
+__RCSID($NetBSD: route.c,v 1.120 2010/05/12 17:56:13 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -843,9 +843,15 @@
 			case K_REJECT:
 flags |= RTF_REJECT;
 break;
+			case 

CVS commit: src/sys/arch/hpcsh/dev/hd64461

2010-05-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed May 12 18:16:53 UTC 2010

Modified Files:
src/sys/arch/hpcsh/dev/hd64461: hd64461uart.c

Log Message:
Suply clock SAFECKE_[IO]ST, if platid is PERSONA.
  tested on HPW-50PA.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hpcsh/dev/hd64461/hd64461uart.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/hpcsh/dev/hd64461/hd64461uart.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.23 src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.24
--- src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.23	Wed May 12 16:41:08 2010
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c	Wed May 12 18:16:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461uart.c,v 1.23 2010/05/12 16:41:08 kiyohara Exp $	*/
+/*	$NetBSD: hd64461uart.c,v 1.24 2010/05/12 18:16:53 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hd64461uart.c,v 1.23 2010/05/12 16:41:08 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: hd64461uart.c,v 1.24 2010/05/12 18:16:53 kiyohara Exp $);
 
 #include opt_kgdb.h
 
@@ -45,6 +45,8 @@
 #include machine/bus.h
 #include machine/intr.h
 #include machine/console.h
+#include machine/platid.h
+#include machine/platid_mask.h
 
 #include dev/ic/comvar.h
 #include dev/ic/comreg.h
@@ -153,7 +155,7 @@
 	struct hd64461_attach_args *ha = aux;
 	struct hd64461uart_softc *sc = device_private(self);
 	struct com_softc *csc = sc-sc_com;
-	uint16_t r16;
+	uint16_t r16, or16;
 	bus_space_handle_t ioh;
 
 	csc-sc_dev = self;
@@ -171,17 +173,19 @@
 	/* switch port to UART */
 
 	/* supply clock */
-	r16 = hd64461_reg_read_2(HD64461_SYSSTBCR_REG16);
+	r16 = or16 = hd64461_reg_read_2(HD64461_SYSSTBCR_REG16);
 	r16 = ~HD64461_SYSSTBCR_SURTSD;
+	if (platid_match(platid, platid_mask_MACH_HITACHI_PERSONA))
+		r16 = ~(HD64461_SYSSTBCR_SAFECKE_IST |
+		HD64461_SYSSTBCR_SAFECKE_OST);
 	hd64461_reg_write_2(HD64461_SYSSTBCR_REG16, r16);
 
 	/* sanity check */
 	if (!com_probe_subr(csc-sc_regs)) {
 		aprint_error(: device problem. don't attach.\n);
 
-		/* stop clock */
-		r16 |= HD64461_SYSSTBCR_SURTSD;
-		hd64461_reg_write_2(HD64461_SYSSTBCR_REG16, r16);
+		/* restore old clock */
+		hd64461_reg_write_2(HD64461_SYSSTBCR_REG16, or16);
 		return;
 	}
 



CVS commit: src/sys/arch/hpcsh/dev/hd64461

2010-05-12 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Wed May 12 18:22:36 UTC 2010

Modified Files:
src/sys/arch/hpcsh/dev/hd64461: hd64461uart.c

Log Message:
Style.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hpcsh/dev/hd64461/hd64461uart.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/hpcsh/dev/hd64461/hd64461uart.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.24 src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.25
--- src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c:1.24	Wed May 12 18:16:53 2010
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461uart.c	Wed May 12 18:22:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461uart.c,v 1.24 2010/05/12 18:16:53 kiyohara Exp $	*/
+/*	$NetBSD: hd64461uart.c,v 1.25 2010/05/12 18:22:36 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hd64461uart.c,v 1.24 2010/05/12 18:16:53 kiyohara Exp $);
+__KERNEL_RCSID(0, $NetBSD: hd64461uart.c,v 1.25 2010/05/12 18:22:36 kiyohara Exp $);
 
 #include opt_kgdb.h
 
@@ -124,20 +124,20 @@
 {
 
 	if (strcmp(kgdb_devname, hd64461uart) != 0)
-		return (1);
+		return 1;
 
 	if (hd64461uart_chip.console)
-		return (1);	/* can't share with console */
+		return 1;	/* can't share with console */
 
 	hd64461uart_init();
 
 	if (com_kgdb_attach(hd64461uart_chip.io_tag, 0x0, kgdb_rate,
 	COM_FREQ, COM_TYPE_NORMAL, CONMODE) != 0) {
 		printf(%s: KGDB console open failed.\n, __func__);
-		return (1);
+		return 1;
 	}
 
-	return (0);
+	return 0;
 }
 #endif /* KGDB */
 
@@ -146,7 +146,7 @@
 {
 	struct hd64461_attach_args *ha = aux;
 
-	return (ha-ha_module_id == HD64461_MODULE_UART);
+	return ha-ha_module_id == HD64461_MODULE_UART;
 }
 
 STATIC void



CVS commit: src/lib/libusbhid

2010-05-12 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed May 12 18:28:20 UTC 2010

Modified Files:
src/lib/libusbhid: data.c

Log Message:
hid_get_data() will read an extra byte if the data being read ends on
a byte boundary. This byte is subsequently discarded, but it could be
a byte from memory after the end of the report being parsed.

Fix this by rounding up and ending the loop one earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libusbhid/data.c

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

Modified files:

Index: src/lib/libusbhid/data.c
diff -u src/lib/libusbhid/data.c:1.5 src/lib/libusbhid/data.c:1.6
--- src/lib/libusbhid/data.c:1.5	Wed Dec 14 17:35:40 2005
+++ src/lib/libusbhid/data.c	Wed May 12 18:28:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: data.c,v 1.5 2005/12/14 17:35:40 wiz Exp $	*/
+/*	$NetBSD: data.c,v 1.6 2010/05/12 18:28:20 plunky Exp $	*/
 
 /*
  * Copyright (c) 1999 Lennart Augustsson augus...@netbsd.org
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: data.c,v 1.5 2005/12/14 17:35:40 wiz Exp $);
+__RCSID($NetBSD: data.c,v 1.6 2010/05/12 18:28:20 plunky Exp $);
 
 #include assert.h
 #include stdlib.h
@@ -52,9 +52,9 @@
 	if (hsize == 0)
 		return (0);
 	offs = hpos / 8;
-	end = (hpos + hsize) / 8 - offs;
+	end = (hpos + hsize + 7) / 8 - offs;
 	data = 0;
-	for (i = 0; i = end; i++)
+	for (i = 0; i  end; i++)
 		data |= buf[offs + i]  (i*8);
 	data = hpos % 8;
 	data = (1  hsize) - 1;



CVS commit: src/sys/arch/sandpoint/stand/netboot

2010-05-12 Thread Frank Wille
Module Name:src
Committed By:   phx
Date:   Wed May 12 18:33:09 UTC 2010

Modified Files:
src/sys/arch/sandpoint/stand/netboot: brdsetup.c

Log Message:
Typo: DHB should be DMB (most significant bye, not high byte).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sandpoint/stand/netboot/brdsetup.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/sandpoint/stand/netboot/brdsetup.c
diff -u src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.11 src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.12
--- src/sys/arch/sandpoint/stand/netboot/brdsetup.c:1.11	Sat May  8 19:41:07 2010
+++ src/sys/arch/sandpoint/stand/netboot/brdsetup.c	Wed May 12 18:33:09 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: brdsetup.c,v 1.11 2010/05/08 19:41:07 phx Exp $ */
+/* $NetBSD: brdsetup.c,v 1.12 2010/05/12 18:33:09 phx Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
 unsigned uart2base;	/* optional satellite processor */
 #define THR		0
 #define DLB		0
-#define DHB		1
+#define DMB		1
 #define IER		1
 #define FCR		2
 #define LCR		3
@@ -88,7 +88,7 @@
 	div = busclock / speed / 16;
 	UART_WRITE(base, LCR, 0x80);		/* turn on DLAB bit */
 	UART_WRITE(base, FCR, 0x00);
-	UART_WRITE(base, DHB, div  8);	/* set speed */
+	UART_WRITE(base, DMB, div  8);	/* set speed */
 	UART_WRITE(base, DLB, div  0xff);
 	UART_WRITE(base, LCR, lcr);
 	UART_WRITE(base, FCR, 0x07);		/* FIFO on, TXRX FIFO reset */



CVS commit: src/lib/libusbhid

2010-05-12 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed May 12 18:37:56 UTC 2010

Modified Files:
src/lib/libusbhid: usbhid.3

Log Message:
note const from actual API


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libusbhid/usbhid.3

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

Modified files:

Index: src/lib/libusbhid/usbhid.3
diff -u src/lib/libusbhid/usbhid.3:1.12 src/lib/libusbhid/usbhid.3:1.13
--- src/lib/libusbhid/usbhid.3:1.12	Mon Mar 22 21:58:58 2010
+++ src/lib/libusbhid/usbhid.3	Wed May 12 18:37:56 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: usbhid.3,v 1.12 2010/03/22 21:58:58 joerg Exp $
+.\	$NetBSD: usbhid.3,v 1.13 2010/05/12 18:37:56 plunky Exp $
 .\
 .\ Copyright (c) 1999, 2001 Lennart Augustsson augus...@netbsd.org
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd December 29, 2001
+.Dd May 12, 2010
 .Dt USBHID 3
 .Os
 .Sh NAME
@@ -72,11 +72,11 @@
 .Ft char *
 .Fn hid_parse_usage_in_page const char *
 .Ft void
-.Fn hid_init char *file
+.Fn hid_init const char *file
 .Ft int
-.Fn hid_get_data void *data hid_item_t *h
+.Fn hid_get_data const void *data const hid_item_t *h
 .Ft void
-.Fn hid_set_data void *data hid_item_t *h u_int data
+.Fn hid_set_data void *data const hid_item_t *h u_int data
 .Sh DESCRIPTION
 The
 .Nm



CVS commit: src/sys/dev/usb

2010-05-12 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed May 12 18:44:49 UTC 2010

Modified Files:
src/sys/dev/usb: hid.c hid.h

Log Message:
hid_get_data() does not work if the size of data is less than
a byte and crosses a byte boundary, and it always returns a
sign-extended value.

fix this by using the algorithm from libusbhid to read bytes,
and provide a hid_get_udata() function to return unsigned data
values.

while here, const args


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/hid.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/hid.h

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

Modified files:

Index: src/sys/dev/usb/hid.c
diff -u src/sys/dev/usb/hid.c:1.28 src/sys/dev/usb/hid.c:1.29
--- src/sys/dev/usb/hid.c:1.28	Mon Apr 28 20:23:59 2008
+++ src/sys/dev/usb/hid.c	Wed May 12 18:44:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.c,v 1.28 2008/04/28 20:23:59 martin Exp $	*/
+/*	$NetBSD: hid.c,v 1.29 2010/05/12 18:44:48 plunky Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hid.c,v 1.28 2008/04/28 20:23:59 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: hid.c,v 1.29 2010/05/12 18:44:48 plunky Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -427,30 +427,43 @@
 	return (0);
 }
 
+long
+hid_get_data(const u_char *buf, const struct hid_location *loc)
+{
+	u_int hsize = loc-size;
+	u_long data;
+
+	if (hsize == 0)
+		return (0);
+
+	data = hid_get_udata(buf, loc);
+	if (data  (1  (hsize - 1)))
+		return (data);
+	return data - (1  hsize);
+}
+
 u_long
-hid_get_data(u_char *buf, struct hid_location *loc)
+hid_get_udata(const u_char *buf, const struct hid_location *loc)
 {
 	u_int hpos = loc-pos;
 	u_int hsize = loc-size;
-	u_int32_t data;
-	int i, s;
-
-	DPRINTFN(10, (hid_get_data: loc %d/%d\n, hpos, hsize));
+	u_int i, num, off;
+	u_long data;
 
 	if (hsize == 0)
 		return (0);
 
 	data = 0;
-	s = hpos / 8;
-	for (i = hpos; i  hpos+hsize; i += 8)
-		data |= buf[i / 8]  ((i / 8 - s) * 8);
+	off = hpos / 8;
+	num = (hpos + hsize + 7) / 8 - off;
+
+	for (i = 0; i  num; i++)
+		data |= buf[off + i]  (i * 8);
+
 	data = hpos % 8;
 	data = (1  hsize) - 1;
-	hsize = 32 - hsize;
-	/* Sign extend */
-	data = ((int32_t)data  hsize)  hsize;
-	DPRINTFN(10,(hid_get_data: loc %d/%d = %lu\n,
-		loc-pos, loc-size, (long)data));
+
+	DPRINTFN(10,(hid_get_data: loc %d/%d = %lu\n, hpos, hsize, data));
 	return (data);
 }
 

Index: src/sys/dev/usb/hid.h
diff -u src/sys/dev/usb/hid.h:1.12 src/sys/dev/usb/hid.h:1.13
--- src/sys/dev/usb/hid.h:1.12	Mon Apr 28 20:23:59 2008
+++ src/sys/dev/usb/hid.h	Wed May 12 18:44:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hid.h,v 1.12 2008/04/28 20:23:59 martin Exp $	*/
+/*	$NetBSD: hid.h,v 1.13 2010/05/12 18:44:49 plunky Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/hid.h,v 1.7 1999/11/17 22:33:40 n_hibma Exp $ */
 
 /*
@@ -84,5 +84,6 @@
 int hid_report_size(const void *, int, enum hid_kind, u_int8_t);
 int hid_locate(const void *, int, u_int32_t, u_int8_t, enum hid_kind,
 struct hid_location *, u_int32_t *);
-u_long hid_get_data(u_char *, struct hid_location *);
+long hid_get_data(const u_char *, const struct hid_location *);
+u_long hid_get_udata(const u_char *, const struct hid_location *);
 int hid_is_collection(const void *, int, u_int8_t, u_int32_t);



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

2010-05-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed May 12 19:11:33 UTC 2010

Modified Files:
src/sys/arch/sbmips/sbmips [matt-nb5-mips64]: sb1250_icu.c

Log Message:
Force the Watchdog interrupts to NMI and don't mask them.


To generate a diff of this commit:
cvs rdiff -u -r1.9.36.11 -r1.9.36.12 src/sys/arch/sbmips/sbmips/sb1250_icu.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/sbmips/sbmips/sb1250_icu.c
diff -u src/sys/arch/sbmips/sbmips/sb1250_icu.c:1.9.36.11 src/sys/arch/sbmips/sbmips/sb1250_icu.c:1.9.36.12
--- src/sys/arch/sbmips/sbmips/sb1250_icu.c:1.9.36.11	Tue Mar 16 02:34:48 2010
+++ src/sys/arch/sbmips/sbmips/sb1250_icu.c	Wed May 12 19:11:33 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sb1250_icu.c,v 1.9.36.11 2010/03/16 02:34:48 matt Exp $ */
+/* $NetBSD: sb1250_icu.c,v 1.9.36.12 2010/05/12 19:11:33 matt Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sb1250_icu.c,v 1.9.36.11 2010/03/16 02:34:48 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: sb1250_icu.c,v 1.9.36.12 2010/05/12 19:11:33 matt Exp $);
 
 #define	__INTR_PRIVATE
 
@@ -207,9 +207,10 @@
 	MIPS_PHYS_TO_KSEG1(A_IMR_MAPPER(cpu-sb1cpu_ci-ci_cpuid));
 #ifdef MULTIPROCESSOR
 	cpu-sb1cpu_imr_all =
-	~(M_INT_MBOX_0|M_INT_MBOX_1|M_INT_MBOX_2|M_INT_MBOX_3);
+	~(M_INT_MBOX_0|M_INT_MBOX_1|M_INT_MBOX_2|M_INT_MBOX_3
+	  |M_INT_WATCHDOG_TIMER_0|M_INT_WATCHDOG_TIMER_1);
 #else
-	cpu-sb1cpu_imr_all = ~0ULL;
+	cpu-sb1cpu_imr_all = ~(M_INT_WATCHDOG_TIMER_0|M_INT_WATCHDOG_TIMER_1);
 #endif
 
 	for (u_int i = 0; i  K_INT_SOURCES; i++, evcnts++) {
@@ -217,6 +218,8 @@
 		evcnt_attach_dynamic(evcnts, EVCNT_TYPE_INTR, NULL,
 		xname, sb1250_intr_names[i]);
 	}
+	WRITE_REG(cpu-sb1cpu_imr_base + SB1250_I_MAP(K_INT_WATCHDOG_TIMER_0), K_INT_MAP_NMI);
+	WRITE_REG(cpu-sb1cpu_imr_base + SB1250_I_MAP(K_INT_WATCHDOG_TIMER_1), K_INT_MAP_NMI);
 
 	WRITE_REG(cpu-sb1cpu_imr_base + R_IMR_INTERRUPT_MASK, cpu-sb1cpu_imr_all);
 #ifdef MULTIPROCESSOR



CVS commit: src/sbin/route

2010-05-12 Thread Mihai Chelaru
Module Name:src
Committed By:   kefren
Date:   Wed May 12 19:26:33 UTC 2010

Modified Files:
src/sbin/route: keywords.sh

Log Message:
Update also keywords.{c,h} generator in order to reflect latest changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/route/keywords.sh

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

Modified files:

Index: src/sbin/route/keywords.sh
diff -u src/sbin/route/keywords.sh:1.7 src/sbin/route/keywords.sh:1.8
--- src/sbin/route/keywords.sh:1.7	Sat Jul 19 01:36:47 2003
+++ src/sbin/route/keywords.sh	Wed May 12 19:26:33 2010
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: keywords.sh,v 1.7 2003/07/19 01:36:47 jrf Exp $
+# $NetBSD: keywords.sh,v 1.8 2010/05/12 19:26:33 kefren Exp $
 # @(#)keywords	8.2 (Berkeley) 3/19/94
 #
 # WARNING!  If you change this file, re-run it!
@@ -57,6 +57,10 @@
 xns
 xresolve
 flushall
+nocloned
+nocloning
+noblackhole
+noreject
 _EOF_
 
 
@@ -81,7 +85,7 @@
 /* WARNING!  This file was generated by keywords.sh  */
 
 extern struct keytab {
-	char	*kt_cp;
+	const char *kt_cp;
 	int	kt_i;
 } keywords[];
 



CVS commit: src/sys/dev/ic

2010-05-12 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed May 12 20:58:52 UTC 2010

Modified Files:
src/sys/dev/ic: igsfb.c

Log Message:
set RI_NO_AUTO then attaching early, clear it otherwise


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/ic/igsfb.c

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

Modified files:

Index: src/sys/dev/ic/igsfb.c
diff -u src/sys/dev/ic/igsfb.c:1.48 src/sys/dev/ic/igsfb.c:1.49
--- src/sys/dev/ic/igsfb.c:1.48	Thu Dec 24 19:16:28 2009
+++ src/sys/dev/ic/igsfb.c	Wed May 12 20:58:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb.c,v 1.48 2009/12/24 19:16:28 elad Exp $ */
+/*	$NetBSD: igsfb.c,v 1.49 2010/05/12 20:58:52 macallan Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Valeriy E. Ushakov
@@ -31,7 +31,7 @@
  * Integraphics Systems IGA 168x and CyberPro series.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: igsfb.c,v 1.48 2009/12/24 19:16:28 elad Exp $);
+__KERNEL_RCSID(0, $NetBSD: igsfb.c,v 1.49 2010/05/12 20:58:52 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -279,10 +279,6 @@
 		}
 	}
 
-	/*
-	 * XXX: TODO: make it possible to select the desired video mode.
-	 * For now - hardcode to 1024x768/8bpp.  This is what Krups OFW uses.
-	 */
 	igsfb_hw_setup(dc);
 
 	/*
@@ -408,11 +404,17 @@
 	struct rasops_info *ri = scr-scr_ri;
 	int wsfcookie;
 
-	if ((scr == dc-dc_console)  (dc-dc_vd.active != NULL))
-		return;
-
+	if (scr == dc-dc_console) {
+		if (ri-ri_flg == 0) {
+			/* first time, need to set RI_NO_AUTO */
+			ri-ri_flg |= RI_NO_AUTO;
+		} else {
+			/* clear it on 2nd run */
+			ri-ri_flg = ~RI_NO_AUTO;
+		}
+	}
+	ri-ri_flg |= RI_CENTER | RI_FULLCLEAR;
 
-	ri-ri_flg = RI_CENTER | RI_FULLCLEAR;
 	if (IGSFB_HW_SOFT_BSWAP(dc))
 		ri-ri_flg |= RI_BSWAP;
 



CVS commit: src/sbin/restore

2010-05-12 Thread Marc Balmer
Module Name:src
Committed By:   mbalmer
Date:   Wed May 12 21:21:59 UTC 2010

Modified Files:
src/sbin/restore: symtab.c

Log Message:
Fix grammar in a line of output.
From Hywel Mallett via FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sbin/restore/symtab.c

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

Modified files:

Index: src/sbin/restore/symtab.c
diff -u src/sbin/restore/symtab.c:1.25 src/sbin/restore/symtab.c:1.26
--- src/sbin/restore/symtab.c:1.25	Tue Apr  7 12:38:12 2009
+++ src/sbin/restore/symtab.c	Wed May 12 21:21:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: symtab.c,v 1.25 2009/04/07 12:38:12 lukem Exp $	*/
+/*	$NetBSD: symtab.c,v 1.26 2010/05/12 21:21:59 mbalmer Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)symtab.c	8.3 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: symtab.c,v 1.25 2009/04/07 12:38:12 lukem Exp $);
+__RCSID($NetBSD: symtab.c,v 1.26 2010/05/12 21:21:59 mbalmer Exp $);
 #endif
 #endif /* not lint */
 
@@ -456,7 +456,7 @@
 	FILE *fd;
 	struct symtableheader hdr;
 
-	vprintf(stdout, Check pointing the restore\n);
+	vprintf(stdout, Checkpointing the restore\n);
 	if (Nflag)
 		return;
 	if ((fd = fopen(filename, w)) == NULL) {



CVS commit: src/external/bsd/top/dist/machine

2010-05-12 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 12 22:09:36 UTC 2010

Modified Files:
src/external/bsd/top/dist/machine: m_netbsd.c

Log Message:
implement fullcmd mode. Now we need to modernize the machine specific code
to handle displays  80 columns to make this work effectively.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/top/dist/machine/m_netbsd.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/top/dist/machine/m_netbsd.c
diff -u src/external/bsd/top/dist/machine/m_netbsd.c:1.11 src/external/bsd/top/dist/machine/m_netbsd.c:1.12
--- src/external/bsd/top/dist/machine/m_netbsd.c:1.11	Wed Oct 21 17:11:57 2009
+++ src/external/bsd/top/dist/machine/m_netbsd.c	Wed May 12 18:09:36 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: m_netbsd.c,v 1.11 2009/10/21 21:11:57 rmind Exp $	*/
+/*	$NetBSD: m_netbsd.c,v 1.12 2010/05/12 22:09:36 christos Exp $	*/
 
 /*
  * top - a top users display for Unix
@@ -37,12 +37,12 @@
  *		Andrew Doran a...@netbsd.org
  *
  *
- * $Id: m_netbsd.c,v 1.11 2009/10/21 21:11:57 rmind Exp $
+ * $Id: m_netbsd.c,v 1.12 2010/05/12 22:09:36 christos Exp $
  */
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: m_netbsd.c,v 1.11 2009/10/21 21:11:57 rmind Exp $);
+__RCSID($NetBSD: m_netbsd.c,v 1.12 2010/05/12 22:09:36 christos Exp $);
 #endif
 
 #include sys/param.h
@@ -70,14 +70,15 @@
 #include loadavg.h
 #include username.h
 
-static void percentages64 __P((int, int *, u_int64_t *, u_int64_t *,
-u_int64_t *));
-static int get_cpunum __P((u_int64_t));
+static void percentages64(int, int *, u_int64_t *, u_int64_t *,
+u_int64_t *);
+static int get_cpunum(u_int64_t);
 
 
 /* get_process_info passes back a handle.  This is what it looks like: */
 
 struct handle {
+	struct process_select *sel;
 	struct kinfo_proc2 **next_proc;	/* points to next valid proc pointer */
 	int remaining;		/* number of pointers remaining */
 };
@@ -188,17 +189,17 @@
 };
 
 /* forward definitions for comparison functions */
-static int compare_cpu __P((struct proc **, struct proc **));
-static int compare_prio __P((struct proc **, struct proc **));
-static int compare_res __P((struct proc **, struct proc **));
-static int compare_size __P((struct proc **, struct proc **));
-static int compare_state __P((struct proc **, struct proc **));
-static int compare_time __P((struct proc **, struct proc **));
-static int compare_pid __P((struct proc **, struct proc **));
-static int compare_command __P((struct proc **, struct proc **));
-static int compare_username __P((struct proc **, struct proc **));
+static int compare_cpu(struct proc **, struct proc **);
+static int compare_prio(struct proc **, struct proc **);
+static int compare_res(struct proc **, struct proc **);
+static int compare_size(struct proc **, struct proc **);
+static int compare_state(struct proc **, struct proc **);
+static int compare_time(struct proc **, struct proc **);
+static int compare_pid(struct proc **, struct proc **);
+static int compare_command(struct proc **, struct proc **);
+static int compare_username(struct proc **, struct proc **);
 
-int (*proc_compares[]) __P((struct proc **, struct proc **)) = {
+int (*proc_compares[])(struct proc **, struct proc **) = {
 	compare_cpu,
 	compare_prio,
 	compare_res,
@@ -248,6 +249,57 @@
 
 #define pagetok(size) ((size)  pageshift)
 
+/*
+ * Print swapped processes as pname and
+ * system processes as [pname]
+ */
+static const char *
+get_pretty(const struct kinfo_proc2 *pp)
+{
+	if ((pp-p_flag  P_SYSTEM) != 0)
+		return [];
+	if ((pp-p_flag  P_INMEM) == 0)
+		return ;
+	return ;
+}
+
+static const char *
+get_command(const struct process_select *sel, struct kinfo_proc2 *pp)
+{
+	static char cmdbuf[128];
+	const char *pretty;
+	char **argv;
+	if (pp == NULL)
+		return gone;
+	pretty = get_pretty(pp);
+
+	if (sel-fullcmd == 0 || kd == NULL || (argv = kvm_getargv2(kd, pp,
+	sizeof(cmdbuf))) == NULL) {
+		if (pretty[0] != '\0'  pp-p_comm[0] != pretty[0])
+			snprintf(cmdbuf, sizeof(cmdbuf), %c%s%c, pretty[0],
+			printable(pp-p_comm), pretty[1]);
+		else
+			strlcpy(cmdbuf, printable(pp-p_comm), sizeof(cmdbuf));
+	} else {
+		char *d = cmdbuf;
+		if (pretty[0] != '\0'  argv[0][0] != pretty[0]) 
+			*d++ = pretty[0];
+		while (*argv) {
+			const char *s = printable(*argv++);
+			while (d  cmdbuf + sizeof(cmdbuf) - 2 
+			(*d++ = *s++) != '\0')
+continue;
+			if (d  cmdbuf  d  cmdbuf + sizeof(cmdbuf) - 2 
+			d[-1] == '\0')
+d[-1] = ' ';
+		}
+		if (pretty[0] != '\0'  pretty[0] == cmdbuf[0])
+			*d++ = pretty[1];
+		*d++ = '\0';
+	}
+	return cmdbuf;
+}
+
 static int
 get_cpunum(id)
 	u_int64_t id;
@@ -364,6 +416,7 @@
 	statics-swap_names = swapnames;
 	statics-order_names = ordernames;
 	statics-flags.threads = 1;
+	statics-flags.fullcmds = 1;
 
 	mib[0] = CTL_KERN;
 	mib[1] = KERN_BOOTTIME;
@@ -637,6 +690,7 @@
 	/* 

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

2010-05-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 13 05:34:58 UTC 2010

Modified Files:
src/sys/net [matt-nb5-mips64]: route.h

Log Message:
Add RTAX_NAMES macro to initialize an array of names for RTAX_*


To generate a diff of this commit:
cvs rdiff -u -r1.70.16.1.4.1 -r1.70.16.1.4.2 src/sys/net/route.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/net/route.h
diff -u src/sys/net/route.h:1.70.16.1.4.1 src/sys/net/route.h:1.70.16.1.4.2
--- src/sys/net/route.h:1.70.16.1.4.1	Tue May 11 21:00:13 2010
+++ src/sys/net/route.h	Thu May 13 05:34:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.h,v 1.70.16.1.4.1 2010/05/11 21:00:13 matt Exp $	*/
+/*	$NetBSD: route.h,v 1.70.16.1.4.2 2010/05/13 05:34:58 matt Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -240,6 +240,9 @@
 #define RTAX_BRD	7	/* for NEWADDR, broadcast or p-p dest addr */
 #define RTAX_MAX	8	/* size of array to allocate */
 
+#define	RTAX_NAMES	{ dst, gateway, netmask, genmask, \
+			  ifp, ifa, author, brd }
+
 #define RT_ROUNDUP(a) \
 	((a)  0 ? (1 + (((a) - 1) | (sizeof(u_quad_t) - 1))) : sizeof(u_quad_t))
 #define RT_ADVANCE(x, n) (x += RT_ROUNDUP((n)-sa_len))



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

2010-05-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 13 05:36:49 UTC 2010

Modified Files:
src/sys/net [matt-nb5-mips64]: rtsock.c

Log Message:
Make sure all structure lengths are rounded via RT_ROUNDUP in routing messages.
This simplies the protocol since all items will now start on a RT_ROUNDUP
aligned address independent of the structure.


To generate a diff of this commit:
cvs rdiff -u -r1.115.2.4.4.1 -r1.115.2.4.4.2 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.115.2.4.4.1 src/sys/net/rtsock.c:1.115.2.4.4.2
--- src/sys/net/rtsock.c:1.115.2.4.4.1	Tue Apr 27 23:09:07 2010
+++ src/sys/net/rtsock.c	Thu May 13 05:36:49 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.115.2.4.4.1 2010/04/27 23:09:07 matt Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.115.2.4.4.2 2010/05/13 05:36:49 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.115.2.4.4.1 2010/04/27 23:09:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.115.2.4.4.2 2010/05/13 05:36:49 matt Exp $);
 
 #include opt_inet.h
 
@@ -249,6 +249,7 @@
 	rtm-rtm_pid = curproc-p_pid;
 	memset(info, 0, sizeof(info));
 	info.rti_addrs = rtm-rtm_addrs;
+	KASSERT(sizeof(*rtm) == RT_ROUNDUP(sizeof(*rtm)));
 	if (rt_xaddrs(rtm-rtm_type, (const char *)(rtm + 1), len + (char *)rtm,
 	info))
 		senderr(EINVAL);
@@ -583,6 +584,7 @@
 	default:
 		len = sizeof(struct rt_msghdr);
 	}
+	len = RT_ROUNDUP(len);
 	if (len  MHLEN + MLEN)
 		panic(rt_msg1: message too long);
 	else if (len  MHLEN) {
@@ -611,6 +613,7 @@
 		m_copyback(m, len, dlen, sa);
 		len += dlen;
 	}
+	KASSERT(len == RT_ROUNDUP(len));
 	if (m-m_pkthdr.len != len) {
 		m_freem(m);
 		return NULL;
@@ -663,6 +666,7 @@
 	default:
 		len = sizeof(struct rt_msghdr);
 	}
+	len = RT_ROUNDUP(len);
 	if ((cp0 = cp) != NULL)
 		cp += len;
 	for (i = 0; i  RTAX_MAX; i++) {
@@ -702,7 +706,7 @@
 			}
 		}
 	}
-	len = ALIGN(len);
+	KASSERT(len == RT_ROUNDUP(len));
 	if (cp) {
 		struct rt_msghdr *rtm = (struct rt_msghdr *)cp0;
 



CVS commit: [matt-nb5-mips64] src/lib/libc/net

2010-05-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 13 05:38:16 UTC 2010

Modified Files:
src/lib/libc/net [matt-nb5-mips64]: getifaddrs.c

Log Message:
Decode the routing message using the new RT_ROUNDUP alignment restrictions.


To generate a diff of this commit:
cvs rdiff -u -r1.11.20.2 -r1.11.20.3 src/lib/libc/net/getifaddrs.c

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

Modified files:

Index: src/lib/libc/net/getifaddrs.c
diff -u src/lib/libc/net/getifaddrs.c:1.11.20.2 src/lib/libc/net/getifaddrs.c:1.11.20.3
--- src/lib/libc/net/getifaddrs.c:1.11.20.2	Tue May 11 21:01:23 2010
+++ src/lib/libc/net/getifaddrs.c	Thu May 13 05:38:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getifaddrs.c,v 1.11.20.2 2010/05/11 21:01:23 matt Exp $	*/
+/*	$NetBSD: getifaddrs.c,v 1.11.20.3 2010/05/13 05:38:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1995, 1999
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getifaddrs.c,v 1.11.20.2 2010/05/11 21:01:23 matt Exp $);
+__RCSID($NetBSD: getifaddrs.c,v 1.11.20.3 2010/05/13 05:38:16 matt Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -45,6 +45,10 @@
 #include ifaddrs.h
 #include stdlib.h
 #include string.h
+ 
+#ifdef RTDEBUG
+#include stdio.h
+#endif
 
 #ifdef __weak_alias
 __weak_alias(getifaddrs,_getifaddrs)
@@ -76,6 +80,10 @@
 	char *data;
 	char *names;
 
+#ifdef RTDEBUG
+	static const char rtax_names[][8] = RTAX_NAMES;
+#endif
+
 	_DIAGASSERT(pif != NULL);
 
 	mib[0] = CTL_NET;
@@ -97,6 +105,11 @@
 		rtm = (struct rt_msghdr *)(void *)next;
 		if (rtm-rtm_version != RTM_VERSION)
 			continue;
+#ifdef RTDEBUG
+		printf(%d: %zd rtm len=%d type=%d\n, __LINE__,
+			(char *)rtm - buf,
+			rtm-rtm_msglen, rtm-rtm_type);
+#endif
 		switch (rtm-rtm_type) {
 		case RTM_IFINFO:
 			ifm = (struct if_msghdr *)(void *)rtm;
@@ -105,10 +118,18 @@
 
 idx = ifm-ifm_index;
 ++icnt;
-dl = (struct sockaddr_dl *)(void *)(ifm + 1);
+dl = (struct sockaddr_dl *)
+((uintptr_t)ifm + RT_ROUNDUP(sizeof(*ifm)));
 dcnt += SA_RLEN((const struct sockaddr *)(const void *)dl);
-dcnt += sizeof(ifm-ifm_data);
+dcnt += RT_ROUNDUP(sizeof(ifm-ifm_data));
 ncnt += dl-sdl_nlen + 1;
+#ifdef RTDEBUG
+printf(%d: %zd sdl idx=%d dcnt=%#x flags=%#x name=,
+	__LINE__, (const char *)dl - buf, idx,
+	dcnt, ifm-ifm_flags);
+fwrite(dl-sdl_data, 1, dl-sdl_nlen, stdout);
+putchar('\n');
+#endif
 			} else
 idx = 0;
 			break;
@@ -121,8 +142,14 @@
 #define	RTA_MASKS	(RTA_NETMASK | RTA_IFA | RTA_BRD)
 			if (idx == 0 || (ifam-ifam_addrs  RTA_MASKS) == 0)
 break;
-			p = (char *)(void *)(ifam + 1);
+			p = (char *)
+			((uintptr_t)ifam + RT_ROUNDUP(sizeof(*ifam)));
 			++icnt;
+#ifdef RTDEBUG
+			printf(%d: %zd sa index=%d addrs=%#x\n,
+__LINE__, p - buf,
+ifam-ifam_index, ifam-ifam_addrs);
+#endif
 			/* Scan to look for length of address */
 			alen = 0;
 			for (p0 = p, i = 0; i  RTAX_MAX; i++) {
@@ -131,6 +158,11 @@
 	continue;
 sa = (struct sockaddr *)(void *)p;
 len = SA_RLEN(sa);
+#ifdef RTDEBUG
+printf(%d: %zd sa %s len=%d family=%d\n,
+	__LINE__, p - buf, rtax_names[i],
+	sa-sa_len, sa-sa_family);
+#endif
 if (i == RTAX_IFA) {
 	alen = len;
 	break;
@@ -147,6 +179,11 @@
 	dcnt += alen;
 else
 	dcnt += len;
+#ifdef RTDEBUG
+printf(%d: %zd sa %s dcnt=%#x, len=%d family=%d\n,
+	__LINE__, p - buf, rtax_names[i], dcnt,
+	sa-sa_len, sa-sa_family);
+#endif
 p += len;
 			}
 			break;
@@ -158,24 +195,33 @@
 		free(buf);
 		return (0);
 	}
-	data = malloc(sizeof(struct ifaddrs) * icnt + dcnt + ncnt);
+	data = malloc(RT_ROUNDUP(sizeof(struct ifaddrs) * icnt) + dcnt + ncnt);
 	if (data == NULL) {
 		free(buf);
 		return(-1);
 	}
 
 	ifa = (struct ifaddrs *)(void *)data;
-	data += sizeof(struct ifaddrs) * icnt;
+	data += RT_ROUNDUP(sizeof(struct ifaddrs) * icnt);
 	names = data + dcnt;
 
 	memset(ifa, 0, sizeof(struct ifaddrs) * icnt);
 	ift = ifa;
+#ifdef RTDEBUG
+	printf(ifa=%p data=%p names=%p end=%p\n,
+	ifa, data, names, names + ncnt);
+#endif
 
 	idx = 0;
 	for (next = buf; next  buf + needed; next += rtm-rtm_msglen) {
 		rtm = (struct rt_msghdr *)(void *)next;
 		if (rtm-rtm_version != RTM_VERSION)
 			continue;
+#ifdef RTDEBUG
+		printf(%d: %zd rtm len=%d type=%d\n, __LINE__,
+			(char *)rtm - buf,
+			rtm-rtm_msglen, rtm-rtm_type);
+#endif
 		switch (rtm-rtm_type) {
 		case RTM_IFINFO:
 			ifm = (struct if_msghdr *)(void *)rtm;
@@ -183,7 +229,8 @@
 const struct sockaddr_dl *dl;
 
 idx = ifm-ifm_index;
-dl = (struct sockaddr_dl *)(void *)(ifm + 1);
+dl = (struct sockaddr_dl *)
+((uintptr_t)ifm + RT_ROUNDUP(sizeof(*ifm)));
 
 memset(cif, 0, sizeof(cif));
 
@@ -192,6 +239,12 @@
 memcpy(names, dl-sdl_data,
 (size_t)dl-sdl_nlen);
 names[dl-sdl_nlen] = 0;
+
+#ifdef RTDEBUG
+printf(%d: %zd 

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

2010-05-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu May 13 05:51:48 UTC 2010

Modified Files:
src/sys/net [matt-nb5-mips64]: if.h

Log Message:
Add a spare int field to ifa_msghdr so its length is a multiple of 8.


To generate a diff of this commit:
cvs rdiff -u -r1.140.8.1 -r1.140.8.2 src/sys/net/if.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/net/if.h
diff -u src/sys/net/if.h:1.140.8.1 src/sys/net/if.h:1.140.8.2
--- src/sys/net/if.h:1.140.8.1	Tue May 11 21:00:13 2010
+++ src/sys/net/if.h	Thu May 13 05:51:47 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.140.8.1 2010/05/11 21:00:13 matt Exp $	*/
+/*	$NetBSD: if.h,v 1.140.8.2 2010/05/13 05:51:47 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -514,6 +514,7 @@
 	int	ifam_flags;	/* value of ifa_flags */
 	u_short	ifam_index;	/* index for associated ifp */
 	int	ifam_metric;	/* value of ifa_metric */
+	int	ifam_spare;	/* pad to multiple of 64 bits */
 };
 
 /*