re: CVS commit: src/sys/dev

2010-02-26 Thread matthew green

   Module Name: src
   Committed By:dyoung
   Date:Thu Feb 25 23:40:39 UTC 2010
   
   Modified Files:
src/sys/dev/cardbus: adv_cardbus.c ahc_cardbus.c com_cardbus.c
ehci_cardbus.c fwohci_cardbus.c if_ath_cardbus.c if_atw_cardbus.c
if_ex_cardbus.c if_fxp_cardbus.c if_ral_cardbus.c if_re_cardbus.c
if_rtk_cardbus.c if_tlp_cardbus.c njata_cardbus.c njs_cardbus.c
ohci_cardbus.c rbus_ppb.c uhci_cardbus.c
src/sys/dev/ic: i82557.c i82557var.h
   
   Log Message:
   Make fxp at cardbus detach during shutdown.
   
   Stop calling (*cardbus_ctrl) to enable bus mastering, I/O and memory
   spaces on the CardBus bridge.  cbb(4) always enables that stuff,
   anyway.  In the process, avoid remembering what BAR we mapped by
   writing CARDBUS_{IO,MEM}_ENABLE to sc_cben or sc_cbenable, and
   record the BAR in use sc_bar, instead.
   
   Replace more CARDBUS_ constants with PCI_ constants.
   
   Compile-tested, only.


this is a pretty serious change to have only compile tested!
can you please get some real testing done on this?


.mrg.


CVS commit: src/tests/lib/libc

2010-02-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 26 09:35:08 UTC 2010

Modified Files:
src/tests/lib/libc: Makefile
src/tests/lib/libc/string: Makefile

Log Message:
Disable population count test for now, please re-enable once
PR toolchain/42885 is fixed


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/string/Makefile

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



CVS commit: src/tests/lib/libc

2010-02-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Feb 26 09:35:08 UTC 2010

Modified Files:
src/tests/lib/libc: Makefile
src/tests/lib/libc/string: Makefile

Log Message:
Disable population count test for now, please re-enable once
PR toolchain/42885 is fixed


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/string/Makefile

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

Modified files:

Index: src/tests/lib/libc/Makefile
diff -u src/tests/lib/libc/Makefile:1.3 src/tests/lib/libc/Makefile:1.4
--- src/tests/lib/libc/Makefile:1.3	Sun Jan 24 21:12:17 2010
+++ src/tests/lib/libc/Makefile	Fri Feb 26 09:35:08 2010
@@ -1,8 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2010/01/24 21:12:17 joerg Exp $
+# $NetBSD: Makefile,v 1.4 2010/02/26 09:35:08 martin Exp $
 
 .include bsd.own.mk
 
-SUBDIR+=	hash stdlib string
+SUBDIR+=	hash stdlib
+
+# Disabled for now, only test in there is very expensive
+#SUBDIR+=	 string
 
 TESTSDIR=	${TESTSBASE}/lib/libc
 

Index: src/tests/lib/libc/string/Makefile
diff -u src/tests/lib/libc/string/Makefile:1.1 src/tests/lib/libc/string/Makefile:1.2
--- src/tests/lib/libc/string/Makefile:1.1	Tue Jul 21 13:18:44 2009
+++ src/tests/lib/libc/string/Makefile	Fri Feb 26 09:35:08 2010
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.1 2009/07/21 13:18:44 joerg Exp $
+# $NetBSD: Makefile,v 1.2 2010/02/26 09:35:08 martin Exp $
 
 .include bsd.own.mk
 
 TESTSDIR=	${TESTSBASE}/lib/libc/string
 
+# EXPENSIVE, REALY, REALY EXPENSIVE test!
 TESTS_C+=	t_popcount
 
 .include bsd.test.mk



CVS commit: src/sys/fs/udf

2010-02-26 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Feb 26 09:57:39 UTC 2010

Modified Files:
src/sys/fs/udf: udf_allocation.c

Log Message:
Typo and style


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/fs/udf/udf_allocation.c

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



CVS commit: src/sys/fs/udf

2010-02-26 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Fri Feb 26 09:57:39 UTC 2010

Modified Files:
src/sys/fs/udf: udf_allocation.c

Log Message:
Typo and style


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/fs/udf/udf_allocation.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/fs/udf/udf_allocation.c
diff -u src/sys/fs/udf/udf_allocation.c:1.28 src/sys/fs/udf/udf_allocation.c:1.29
--- src/sys/fs/udf/udf_allocation.c:1.28	Thu Feb 25 16:15:57 2010
+++ src/sys/fs/udf/udf_allocation.c	Fri Feb 26 09:57:39 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_allocation.c,v 1.28 2010/02/25 16:15:57 reinoud Exp $ */
+/* $NetBSD: udf_allocation.c,v 1.29 2010/02/26 09:57:39 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__KERNEL_RCSID(0, $NetBSD: udf_allocation.c,v 1.28 2010/02/25 16:15:57 reinoud Exp $);
+__KERNEL_RCSID(0, $NetBSD: udf_allocation.c,v 1.29 2010/02/26 09:57:39 reinoud Exp $);
 #endif /* not lint */
 
 
@@ -1499,7 +1499,7 @@
 	DPRINTF(RESERVE, (\tfree space on metadata partition %PRIu64 blks\n, meta_free_lbs));
 
 	/* give away some of the free meta space, in unit block sizes */
-	to_trunc = meta_free_lbs/4;			/* give out a quart */
+	to_trunc = meta_free_lbs/4;			/* give out a quarter */
 	to_trunc = MAX(to_trunc, num_lb);
 	to_trunc = unit * ((to_trunc + unit-1) / unit);	/* round up */
 
@@ -1534,7 +1534,6 @@
 	sbd-num_bytes = udf_rw32(sbd-num_bytes) - to_trunc/8;
 	bitmap-max_offset = udf_rw32(sbd-num_bits);
 
-
 	num_vpart = udf_rw32(lvid-num_part);
 	freepos = lvid-tables[0] + meta_vpart_num;
 	sizepos = lvid-tables[0] + num_vpart + meta_vpart_num;



Re: CVS commit: src/sys/dev

2010-02-26 Thread Matthias Drochner

m...@eterna.com.au said:
 this is a pretty serious change to have only compile tested! can you
 please get some real testing done on this?

Seconded.
And: Starting to commit without having an idea what it breaks
and where it ends isn't great engineering either.

best regards
Matthias





Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt




CVS commit: [uebayasi-xip] src/sys/arch/powerpc

2010-02-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Feb 26 14:40:23 UTC 2010

Modified Files:
src/sys/arch/powerpc/oea [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: pmap_subr.c

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.69.2.1 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/powerpc/powerpc/pmap_subr.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/oea/pmap.c
diff -u src/sys/arch/powerpc/oea/pmap.c:1.69 src/sys/arch/powerpc/oea/pmap.c:1.69.2.1
--- src/sys/arch/powerpc/oea/pmap.c:1.69	Sat Nov 21 17:40:29 2009
+++ src/sys/arch/powerpc/oea/pmap.c	Fri Feb 26 14:40:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.69 2009/11/21 17:40:29 rmind Exp $	*/
+/*	$NetBSD: pmap.c,v 1.69.2.1 2010/02/26 14:40:23 uebayasi Exp $	*/
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.69 2009/11/21 17:40:29 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.69.2.1 2010/02/26 14:40:23 uebayasi Exp $);
 
 #define	PMAP_NOOPNAMES
 
@@ -689,38 +689,48 @@
 pa_to_pvoh(paddr_t pa, struct vm_page **pg_p)
 {
 	struct vm_page *pg;
+	struct vm_page_md *md;
 
 	pg = PHYS_TO_VM_PAGE(pa);
 	if (pg_p != NULL)
 		*pg_p = pg;
 	if (pg == NULL)
 		return pmap_pvo_unmanaged;
-	return pg-mdpage.mdpg_pvoh;
+	md = VM_PAGE_TO_MD(pg);
+	return md-mdpg_pvoh;
 }
 
 static inline struct pvo_head *
 vm_page_to_pvoh(struct vm_page *pg)
 {
-	return pg-mdpage.mdpg_pvoh;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	return md-mdpg_pvoh;
 }
 
 
 static inline void
 pmap_attr_clear(struct vm_page *pg, int ptebit)
 {
-	pg-mdpage.mdpg_attrs = ~ptebit;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	md-mdpg_attrs = ~ptebit;
 }
 
 static inline int
 pmap_attr_fetch(struct vm_page *pg)
 {
-	return pg-mdpage.mdpg_attrs;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	return md-mdpg_attrs;
 }
 
 static inline void
 pmap_attr_save(struct vm_page *pg, int ptebit)
 {
-	pg-mdpage.mdpg_attrs |= ptebit;
+	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+
+	md-mdpg_attrs |= ptebit;
 }
 
 static inline int

Index: src/sys/arch/powerpc/powerpc/pmap_subr.c
diff -u src/sys/arch/powerpc/powerpc/pmap_subr.c:1.22 src/sys/arch/powerpc/powerpc/pmap_subr.c:1.22.2.1
--- src/sys/arch/powerpc/powerpc/pmap_subr.c:1.22	Thu Jan 28 12:37:45 2010
+++ src/sys/arch/powerpc/powerpc/pmap_subr.c	Fri Feb 26 14:40:23 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_subr.c,v 1.22 2010/01/28 12:37:45 phx Exp $	*/
+/*	$NetBSD: pmap_subr.c,v 1.22.2.1 2010/02/26 14:40:23 uebayasi Exp $	*/
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_subr.c,v 1.22 2010/01/28 12:37:45 phx Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_subr.c,v 1.22.2.1 2010/02/26 14:40:23 uebayasi Exp $);
 
 #include opt_multiprocessor.h
 #include opt_altivec.h
@@ -293,13 +293,14 @@
 		 */
 		struct vm_page *pg = PHYS_TO_VM_PAGE(pa);
 		KDASSERT(pg != NULL);
-		KDASSERT(LIST_EMPTY(pg-mdpage.mdpg_pvoh));
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+		KDASSERT(LIST_EMPTY(md-mdpg_pvoh));
 #ifdef PMAPCOUNTERS
-		if (pg-mdpage.mdpg_attrs  PTE_EXEC) {
+		if (md-mdpg_attrs  PTE_EXEC) {
 			PMAPCOUNT(exec_uncached_zero_page);
 		}
 #endif
-		pg-mdpage.mdpg_attrs = ~PTE_EXEC;
+		md-mdpg_attrs = ~PTE_EXEC;
 	}
 #endif
 
@@ -373,13 +374,14 @@
 		 */
 		struct vm_page *pg = PHYS_TO_VM_PAGE(dst);
 		KDASSERT(pg != NULL);
-		KDASSERT(LIST_EMPTY(pg-mdpage.mdpg_pvoh));
+		struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
+		KDASSERT(LIST_EMPTY(md-mdpg_pvoh));
 #ifdef PMAPCOUNTERS
-		if (pg-mdpage.mdpg_attrs  PTE_EXEC) {
+		if (md-mdpg_attrs  PTE_EXEC) {
 			PMAPCOUNT(exec_uncached_copy_page);
 		}
 #endif
-		pg-mdpage.mdpg_attrs = ~PTE_EXEC;
+		md-mdpg_attrs = ~PTE_EXEC;
 	}
 #endif
 



CVS commit: [uebayasi-xip] src/sys/arch/powerpc

2010-02-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Fri Feb 26 14:40:23 UTC 2010

Modified Files:
src/sys/arch/powerpc/oea [uebayasi-xip]: pmap.c
src/sys/arch/powerpc/powerpc [uebayasi-xip]: pmap_subr.c

Log Message:
Use VM_PAGE_TO_MD().  Only compile tested.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.69.2.1 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/arch/powerpc/powerpc/pmap_subr.c

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



CVS commit: src/sys/rump

2010-02-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb 26 15:23:20 UTC 2010

Modified Files:
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: rump.c
src/sys/rump/librump/rumpuser: rumpuser_dl.c

Log Message:
Rename rumpuser_dl_module_bootstrap() to rumpuser_dl_bootstrap(),
since it hasn't been involved only with modules for quite a while now.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.152 -r1.153 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/librump/rumpuser/rumpuser_dl.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/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.35 src/sys/rump/include/rump/rumpuser.h:1.36
--- src/sys/rump/include/rump/rumpuser.h:1.35	Wed Dec 23 17:17:59 2009
+++ src/sys/rump/include/rump/rumpuser.h	Fri Feb 26 15:23:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpuser.h,v 1.35 2009/12/23 17:17:59 stacktic Exp $	*/
+/*	$NetBSD: rumpuser.h,v 1.36 2010/02/26 15:23:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -200,6 +200,6 @@
 struct modinfo;
 typedef int (*rump_modinit_fn)(struct modinfo *, prop_dictionary_t);
 typedef int (*rump_symload_fn)(void *, uint64_t, char *, uint64_t);
-void rumpuser_dl_module_bootstrap(rump_modinit_fn, rump_symload_fn);
+void rumpuser_dl_bootstrap(rump_modinit_fn, rump_symload_fn);
 
 #endif /* _RUMP_RUMPUSER_H_ */

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.152 src/sys/rump/librump/rumpkern/rump.c:1.153
--- src/sys/rump/librump/rumpkern/rump.c:1.152	Tue Feb  9 16:53:13 2010
+++ src/sys/rump/librump/rumpkern/rump.c	Fri Feb 26 15:23:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.152 2010/02/09 16:53:13 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.153 2010/02/26 15:23:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.152 2010/02/09 16:53:13 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.153 2010/02/26 15:23:20 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -299,7 +299,7 @@
 
 	sysctl_finalize();
 
-	rumpuser_dl_module_bootstrap(rump_module_init, rump_kernelfsym_load);
+	rumpuser_dl_bootstrap(rump_module_init, rump_kernelfsym_load);
 
 	rumpuser_gethostname(hostname, MAXHOSTNAMELEN, error);
 	hostnamelen = strlen(hostname);

Index: src/sys/rump/librump/rumpuser/rumpuser_dl.c
diff -u src/sys/rump/librump/rumpuser/rumpuser_dl.c:1.11 src/sys/rump/librump/rumpuser/rumpuser_dl.c:1.12
--- src/sys/rump/librump/rumpuser/rumpuser_dl.c:1.11	Tue Dec  8 08:12:49 2009
+++ src/sys/rump/librump/rumpuser/rumpuser_dl.c	Fri Feb 26 15:23:20 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: rumpuser_dl.c,v 1.11 2009/12/08 08:12:49 stacktic Exp $	*/
+/*  $NetBSD: rumpuser_dl.c,v 1.12 2010/02/26 15:23:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: rumpuser_dl.c,v 1.11 2009/12/08 08:12:49 stacktic Exp $);
+__RCSID($NetBSD: rumpuser_dl.c,v 1.12 2010/02/26 15:23:20 pooka Exp $);
 
 #include sys/types.h
 #include sys/time.h
@@ -332,7 +332,7 @@
  * from all objects in the linkmap.
  */
 void
-rumpuser_dl_module_bootstrap(rump_modinit_fn domodinit,
+rumpuser_dl_bootstrap(rump_modinit_fn domodinit,
 	rump_symload_fn symload)
 {
 	struct link_map *map, *origmap;
@@ -404,11 +404,10 @@
 }
 #else
 void
-rumpuser_dl_module_bootstrap(rump_modinit_fn domodinit,
+rumpuser_dl_bootstrap(rump_modinit_fn domodinit,
 	rump_symload_fn symload)
 {
 
 	fprintf(stderr, Warning, dlinfo() unsupported on host?\n);
-	fprintf(stderr, module bootstrap unavailable\n);
 }
 #endif



CVS commit: src/sys/rump

2010-02-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb 26 15:23:20 UTC 2010

Modified Files:
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: rump.c
src/sys/rump/librump/rumpuser: rumpuser_dl.c

Log Message:
Rename rumpuser_dl_module_bootstrap() to rumpuser_dl_bootstrap(),
since it hasn't been involved only with modules for quite a while now.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.152 -r1.153 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.11 -r1.12 src/sys/rump/librump/rumpuser/rumpuser_dl.c

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



CVS commit: src/sys/dev/i2c

2010-02-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Feb 26 18:16:18 UTC 2010

Modified Files:
src/sys/dev/i2c: dbcool.c dbcool_var.h

Log Message:
Disable DBCOOL_DEBUG by default, and make it compile that way.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/dbcool_var.h

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



CVS commit: src/sys/dev/i2c

2010-02-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Feb 26 18:16:18 UTC 2010

Modified Files:
src/sys/dev/i2c: dbcool.c dbcool_var.h

Log Message:
Disable DBCOOL_DEBUG by default, and make it compile that way.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/i2c/dbcool.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/i2c/dbcool_var.h

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

Modified files:

Index: src/sys/dev/i2c/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.16 src/sys/dev/i2c/dbcool.c:1.17
--- src/sys/dev/i2c/dbcool.c:1.16	Wed Feb 24 23:37:45 2010
+++ src/sys/dev/i2c/dbcool.c	Fri Feb 26 18:16:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.16 2010/02/24 23:37:45 pgoyette Exp $ */
+/*	$NetBSD: dbcool.c,v 1.17 2010/02/26 18:16:18 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbcool.c,v 1.16 2010/02/24 23:37:45 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbcool.c,v 1.17 2010/02/26 18:16:18 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1459,7 +1459,9 @@
 {
 	struct dbcool_softc *sc = device_private(self);
 	const struct sysctlnode *me = NULL;
+#ifdef DBCOOL_DEBUG
 	struct sysctlnode *node = NULL;
+#endif
 	uint8_t cfg_val, cfg_reg;
 	int ro_flag, rw_flag, ret, error;
 

Index: src/sys/dev/i2c/dbcool_var.h
diff -u src/sys/dev/i2c/dbcool_var.h:1.9 src/sys/dev/i2c/dbcool_var.h:1.10
--- src/sys/dev/i2c/dbcool_var.h:1.9	Wed Feb 24 23:37:45 2010
+++ src/sys/dev/i2c/dbcool_var.h	Fri Feb 26 18:16:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool_var.h,v 1.9 2010/02/24 23:37:45 pgoyette Exp $ */
+/*	$NetBSD: dbcool_var.h,v 1.10 2010/02/26 18:16:18 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,12 +36,12 @@
 #ifndef DBCOOLVAR_H
 #define DBCOOLVAR_H
 
-#define DBCOOL_DEBUG
 /*
+#define DBCOOL_DEBUG
 */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dbcool_var.h,v 1.9 2010/02/24 23:37:45 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: dbcool_var.h,v 1.10 2010/02/26 18:16:18 pgoyette Exp $);
 
 #include dev/i2c/i2cvar.h
 



CVS commit: src/sys/kern

2010-02-26 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Feb 26 18:47:13 UTC 2010

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

Log Message:
Change RSS (resident set size) limit. Instead of setting it arbitrarily
to the total free memory available to the system, use the smallest value
between VM_MAXUSER_ADDRESS and total free memory (having a RSS limit
bigger than VM_MAXUSER_ADDRESS has no real meaning).

Fix a possible int overflow when ptoa(uvmexp.free) is bigger than 4GB
with a 32 bits vaddr_t.

This change is similar to the one made in rev 1.144 of uvm/uvm_glue.c.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/kern/kern_proc.c

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



CVS commit: src/sys/kern

2010-02-26 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Feb 26 18:47:13 UTC 2010

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

Log Message:
Change RSS (resident set size) limit. Instead of setting it arbitrarily
to the total free memory available to the system, use the smallest value
between VM_MAXUSER_ADDRESS and total free memory (having a RSS limit
bigger than VM_MAXUSER_ADDRESS has no real meaning).

Fix a possible int overflow when ptoa(uvmexp.free) is bigger than 4GB
with a 32 bits vaddr_t.

This change is similar to the one made in rev 1.144 of uvm/uvm_glue.c.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/kern/kern_proc.c

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

Modified files:

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.162 src/sys/kern/kern_proc.c:1.163
--- src/sys/kern/kern_proc.c:1.162	Tue Feb 23 22:19:27 2010
+++ src/sys/kern/kern_proc.c	Fri Feb 26 18:47:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.162 2010/02/23 22:19:27 darran Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.163 2010/02/26 18:47:13 jym Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_proc.c,v 1.162 2010/02/23 22:19:27 darran Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_proc.c,v 1.163 2010/02/26 18:47:13 jym Exp $);
 
 #include opt_kstack.h
 #include opt_maxuprc.h
@@ -418,7 +418,7 @@
 	limit0.pl_rlimit[RLIMIT_NPROC].rlim_cur =
 	maxproc  maxuprc ? maxproc : maxuprc;
 
-	lim = ptoa(uvmexp.free);
+	lim = MIN(VM_MAXUSER_ADDRESS, ctob((rlim_t)uvmexp.free));
 	limit0.pl_rlimit[RLIMIT_RSS].rlim_max = lim;
 	limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = lim;
 	limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = lim / 3;



CVS commit: src

2010-02-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb 26 18:54:21 UTC 2010

Modified Files:
src/lib/librumpuser: Makefile
src/sys/rump/librump: Makefile
Added Files:
src/lib/librumpuser: rumpuser.3 rumpuser.c rumpuser_dl.c rumpuser_int.h
rumpuser_net.c rumpuser_pth.c rumpuser_pth_dummy.c shlib_version
Removed Files:
src/sys/rump/librump/rumpuser: Makefile rumpuser.3 rumpuser.c
rumpuser_dl.c rumpuser_int.h rumpuser_net.c rumpuser_pth.c
rumpuser_pth_dummy.c

Log Message:
librumpuser is not _KERNEL code and does not belong in sys.  Move
the source files from src/sys/rump/librump/rumpuser to src/lib/librumpuser
(from where it is already built).  Even so, keep rumpuser.h in
sys/rump/include for kernel source tree self-containment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/librumpuser/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/librumpuser/rumpuser.3 \
src/lib/librumpuser/rumpuser.c src/lib/librumpuser/rumpuser_dl.c \
src/lib/librumpuser/rumpuser_int.h src/lib/librumpuser/rumpuser_net.c \
src/lib/librumpuser/rumpuser_pth.c \
src/lib/librumpuser/rumpuser_pth_dummy.c \
src/lib/librumpuser/shlib_version
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/Makefile
cvs rdiff -u -r1.16 -r0 src/sys/rump/librump/rumpuser/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/librump/rumpuser/rumpuser.3
cvs rdiff -u -r1.49 -r0 src/sys/rump/librump/rumpuser/rumpuser.c
cvs rdiff -u -r1.12 -r0 src/sys/rump/librump/rumpuser/rumpuser_dl.c
cvs rdiff -u -r1.4 -r0 src/sys/rump/librump/rumpuser/rumpuser_int.h
cvs rdiff -u -r1.7 -r0 src/sys/rump/librump/rumpuser/rumpuser_net.c
cvs rdiff -u -r1.40 -r0 src/sys/rump/librump/rumpuser/rumpuser_pth.c
cvs rdiff -u -r1.8 -r0 src/sys/rump/librump/rumpuser/rumpuser_pth_dummy.c

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



CVS commit: src

2010-02-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb 26 18:54:21 UTC 2010

Modified Files:
src/lib/librumpuser: Makefile
src/sys/rump/librump: Makefile
Added Files:
src/lib/librumpuser: rumpuser.3 rumpuser.c rumpuser_dl.c rumpuser_int.h
rumpuser_net.c rumpuser_pth.c rumpuser_pth_dummy.c shlib_version
Removed Files:
src/sys/rump/librump/rumpuser: Makefile rumpuser.3 rumpuser.c
rumpuser_dl.c rumpuser_int.h rumpuser_net.c rumpuser_pth.c
rumpuser_pth_dummy.c

Log Message:
librumpuser is not _KERNEL code and does not belong in sys.  Move
the source files from src/sys/rump/librump/rumpuser to src/lib/librumpuser
(from where it is already built).  Even so, keep rumpuser.h in
sys/rump/include for kernel source tree self-containment.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/librumpuser/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/librumpuser/rumpuser.3 \
src/lib/librumpuser/rumpuser.c src/lib/librumpuser/rumpuser_dl.c \
src/lib/librumpuser/rumpuser_int.h src/lib/librumpuser/rumpuser_net.c \
src/lib/librumpuser/rumpuser_pth.c \
src/lib/librumpuser/rumpuser_pth_dummy.c \
src/lib/librumpuser/shlib_version
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/Makefile
cvs rdiff -u -r1.16 -r0 src/sys/rump/librump/rumpuser/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/rump/librump/rumpuser/rumpuser.3
cvs rdiff -u -r1.49 -r0 src/sys/rump/librump/rumpuser/rumpuser.c
cvs rdiff -u -r1.12 -r0 src/sys/rump/librump/rumpuser/rumpuser_dl.c
cvs rdiff -u -r1.4 -r0 src/sys/rump/librump/rumpuser/rumpuser_int.h
cvs rdiff -u -r1.7 -r0 src/sys/rump/librump/rumpuser/rumpuser_net.c
cvs rdiff -u -r1.40 -r0 src/sys/rump/librump/rumpuser/rumpuser_pth.c
cvs rdiff -u -r1.8 -r0 src/sys/rump/librump/rumpuser/rumpuser_pth_dummy.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/librumpuser/Makefile
diff -u src/lib/librumpuser/Makefile:1.1 src/lib/librumpuser/Makefile:1.2
--- src/lib/librumpuser/Makefile:1.1	Tue Jul 29 13:17:41 2008
+++ src/lib/librumpuser/Makefile	Fri Feb 26 18:54:20 2010
@@ -1,9 +1,24 @@
-#	$NetBSD: Makefile,v 1.1 2008/07/29 13:17:41 pooka Exp $
+#	$NetBSD: Makefile,v 1.2 2010/02/26 18:54:20 pooka Exp $
 #
 
-.PATH:		${.CURDIR}/../../sys/rump/librump/rumpuser
+WARNS=		4
 
+# rumpuser.h is in sys/rump for inclusion by kernel components
+.PATH:		${.CURDIR}/../../sys/rump/include/rump
+
+LIB=		rumpuser
 LIBDPLIBS+= pthread ${.CURDIR}/../libpthread
+
+SRCS=		rumpuser.c rumpuser_net.c
+SRCS+=		rumpuser_pth.c
+SRCS+=		rumpuser_dl.c
+
+INCSDIR=	/usr/include/rump
+INCS=		rumpuser.h
+
 MAN=		rumpuser.3
 
-.include ${.CURDIR}/../../sys/rump/librump/rumpuser/Makefile
+CPPFLAGS+=	-D_REENTRANT
+
+
+.include bsd.lib.mk

Index: src/sys/rump/librump/Makefile
diff -u src/sys/rump/librump/Makefile:1.7 src/sys/rump/librump/Makefile:1.8
--- src/sys/rump/librump/Makefile:1.7	Tue Nov 17 15:36:28 2009
+++ src/sys/rump/librump/Makefile	Fri Feb 26 18:54:20 2010
@@ -1,11 +1,7 @@
-#	$NetBSD: Makefile,v 1.7 2009/11/17 15:36:28 pooka Exp $
+#	$NetBSD: Makefile,v 1.8 2010/02/26 18:54:20 pooka Exp $
 #
 
 SUBDIR= 	rumpkern
-.if !defined(NORUMPUSER)
-SUBDIR+=	rumpuser
-.endif
-
 SUBDIR+=	rumpcrypto rumpdev rumpnet rumpvfs
 
 .include bsd.subdir.mk

Added files:

Index: src/lib/librumpuser/rumpuser.3
diff -u /dev/null src/lib/librumpuser/rumpuser.3:1.1
--- /dev/null	Fri Feb 26 18:54:21 2010
+++ src/lib/librumpuser/rumpuser.3	Fri Feb 26 18:54:20 2010
@@ -0,0 +1,50 @@
+.\ $NetBSD: rumpuser.3,v 1.1 2010/02/26 18:54:20 pooka Exp $
+.\
+.\ Copyright (c) 2008 Antti Kantee.  All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 

CVS commit: src

2010-02-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb 26 18:57:06 UTC 2010

Modified Files:
src: build.sh

Log Message:
Don't need to set NORUMPUSER since rumpuser isn't built from sys
anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.228 src/build.sh:1.229
--- src/build.sh:1.228	Wed Jan 13 02:24:06 2010
+++ src/build.sh	Fri Feb 26 18:57:06 2010
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.228 2010/01/13 02:24:06 pooka Exp $
+#	$NetBSD: build.sh,v 1.229 2010/02/26 18:57:06 pooka Exp $
 #
 # Copyright (c) 2001-2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1352,7 +1352,7 @@
 	eval cat EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy make building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.228 2010/01/13 02:24:06 pooka Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.229 2010/02/26 18:57:06 pooka Exp $
 # with these arguments: ${_args}
 #
 
@@ -1569,7 +1569,6 @@
 
 	[ ${MKUPDATE} = no ]  doclean=cleandir
 	targlist=${doclean} ${doobjs} dependall install
-	setmakeenv NORUMPUSER 1
 	# optimize: for test we build only static libs (3x test speedup)
 	if [ ${1} = rumptest ] ; then
 		setmakeenv NOPIC 1



CVS commit: src

2010-02-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Feb 26 18:57:06 UTC 2010

Modified Files:
src: build.sh

Log Message:
Don't need to set NORUMPUSER since rumpuser isn't built from sys
anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/build.sh

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



CVS commit: src/sys/arch

2010-02-26 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Feb 26 19:25:07 UTC 2010

Modified Files:
src/sys/arch/amd64/include: pte.h
src/sys/arch/i386/i386: dumpsys.c
src/sys/arch/i386/include: pte.h
src/sys/arch/i386/pci: elan520.c
src/sys/arch/x86/x86: bus_dma.c pmap.c
src/sys/arch/xen/x86: x86_xpmap.c

Log Message:
Fixes regarding paddr_t/pd_entry_t types in MD x86 code, exposed by PAE:

- NBPD_* macros are set to the types that better match their architecture
(UL for i386 and amd64, ULL for i386 PAE) - will revisit when paddr_t is
set to 64 bits for i386 non-PAE.

- type fixes in printf/printk messages (Use PRIxPADDR when printing paddr_t
values, instead of %lx - paddr_t/pd_entry_t being 64 bits with PAE)

- remove casts that are no more needed now that Xen2 support has been dropped

Some fixes are from jmorse@ patches for PAE.

Compile + tested for i386 GENERIC and XEN3 kernels. Only compile tested for
amd64.

Reviewed by bou...@.

See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amd64/include/pte.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/i386/dumpsys.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/include/pte.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/i386/pci/elan520.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/x86/x86_xpmap.c

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



CVS commit: src/sys/arch

2010-02-26 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Fri Feb 26 19:25:07 UTC 2010

Modified Files:
src/sys/arch/amd64/include: pte.h
src/sys/arch/i386/i386: dumpsys.c
src/sys/arch/i386/include: pte.h
src/sys/arch/i386/pci: elan520.c
src/sys/arch/x86/x86: bus_dma.c pmap.c
src/sys/arch/xen/x86: x86_xpmap.c

Log Message:
Fixes regarding paddr_t/pd_entry_t types in MD x86 code, exposed by PAE:

- NBPD_* macros are set to the types that better match their architecture
(UL for i386 and amd64, ULL for i386 PAE) - will revisit when paddr_t is
set to 64 bits for i386 non-PAE.

- type fixes in printf/printk messages (Use PRIxPADDR when printing paddr_t
values, instead of %lx - paddr_t/pd_entry_t being 64 bits with PAE)

- remove casts that are no more needed now that Xen2 support has been dropped

Some fixes are from jmorse@ patches for PAE.

Compile + tested for i386 GENERIC and XEN3 kernels. Only compile tested for
amd64.

Reviewed by bou...@.

See also http://mail-index.netbsd.org/tech-kern/2010/02/22/msg007373.html


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/amd64/include/pte.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/i386/dumpsys.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/include/pte.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/i386/pci/elan520.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/x86/x86_xpmap.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/amd64/include/pte.h
diff -u src/sys/arch/amd64/include/pte.h:1.5 src/sys/arch/amd64/include/pte.h:1.6
--- src/sys/arch/amd64/include/pte.h:1.5	Thu Jan 28 14:10:54 2010
+++ src/sys/arch/amd64/include/pte.h	Fri Feb 26 19:25:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.5 2010/01/28 14:10:54 mbalmer Exp $	*/
+/*	$NetBSD: pte.h,v 1.6 2010/02/26 19:25:07 jym Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -81,10 +81,10 @@
 #define	L2_SHIFT	21
 #define	L3_SHIFT	30
 #define	L4_SHIFT	39
-#define	NBPD_L1		(1ULL  L1_SHIFT) /* # bytes mapped by L1 ent (4K) */
-#define	NBPD_L2		(1ULL  L2_SHIFT) /* # bytes mapped by L2 ent (2MB) */
-#define	NBPD_L3		(1ULL  L3_SHIFT) /* # bytes mapped by L3 ent (1G) */
-#define	NBPD_L4		(1ULL  L4_SHIFT) /* # bytes mapped by L4 ent (512G) */
+#define	NBPD_L1		(1UL  L1_SHIFT) /* # bytes mapped by L1 ent (4K) */
+#define	NBPD_L2		(1UL  L2_SHIFT) /* # bytes mapped by L2 ent (2MB) */
+#define	NBPD_L3		(1UL  L3_SHIFT) /* # bytes mapped by L3 ent (1G) */
+#define	NBPD_L4		(1UL  L4_SHIFT) /* # bytes mapped by L4 ent (512G) */
 
 #define L4_MASK		0xff80
 #define L3_MASK		0x007fc000

Index: src/sys/arch/i386/i386/dumpsys.c
diff -u src/sys/arch/i386/i386/dumpsys.c:1.8 src/sys/arch/i386/i386/dumpsys.c:1.9
--- src/sys/arch/i386/i386/dumpsys.c:1.8	Sat Nov  7 07:27:44 2009
+++ src/sys/arch/i386/i386/dumpsys.c	Fri Feb 26 19:25:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dumpsys.c,v 1.8 2009/11/07 07:27:44 cegger Exp $	*/
+/*	$NetBSD: dumpsys.c,v 1.9 2010/02/26 19:25:07 jym Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dumpsys.c,v 1.8 2009/11/07 07:27:44 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: dumpsys.c,v 1.9 2010/02/26 19:25:07 jym Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -342,8 +342,7 @@
 			max_paddr = top;
 	}
 #ifdef DUMP_DEBUG
-	printf(dump_misc_init: max_paddr = 0x%lx\n,
-	(unsigned long)max_paddr);
+	printf(dump_misc_init: max_paddr = %# PRIxPADDR \n, max_paddr);
 #endif
 
 	sparse_dump_physmap = (void*)uvm_km_alloc(kernel_map,

Index: src/sys/arch/i386/include/pte.h
diff -u src/sys/arch/i386/include/pte.h:1.20 src/sys/arch/i386/include/pte.h:1.21
--- src/sys/arch/i386/include/pte.h:1.20	Tue Nov 17 22:35:43 2009
+++ src/sys/arch/i386/include/pte.h	Fri Feb 26 19:25:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.20 2009/11/17 22:35:43 dyoung Exp $	*/
+/*	$NetBSD: pte.h,v 1.21 2010/02/26 19:25:07 jym Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -221,8 +221,8 @@
 #else /* PAE */
 #define	L1_SHIFT	12
 #define	L2_SHIFT	22
-#define	NBPD_L1		(1ULL  L1_SHIFT) /* # bytes mapped by L1 ent (4K) */
-#define	NBPD_L2		(1ULL  L2_SHIFT) /* # bytes mapped by L2 ent (4MB) */
+#define	NBPD_L1		(1UL  L1_SHIFT) /* # bytes mapped by L1 ent (4K) */
+#define	NBPD_L2		(1UL  L2_SHIFT) /* # bytes mapped by L2 ent (4MB) */
 
 #define L2_MASK		0xffc0
 #define L1_MASK		0x003ff000

Index: src/sys/arch/i386/pci/elan520.c
diff -u src/sys/arch/i386/pci/elan520.c:1.47 src/sys/arch/i386/pci/elan520.c:1.48
--- src/sys/arch/i386/pci/elan520.c:1.47	Wed Feb 24 22:37:55 2010
+++ src/sys/arch/i386/pci/elan520.c	Fri Feb 26 19:25:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: elan520.c,v 1.47 2010/02/24 

CVS commit: src/usr.bin/eject

2010-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 20:18:37 UTC 2010

Modified Files:
src/usr.bin/eject: am_glue.c

Log Message:
PR/42207: YAMAMOTO Takashi: If the portmapper (rpcbind) is not running, eject
takes 2 minutes to timeout. Add a ping the portmapper function that times out
after 5 seconds.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/eject/am_glue.c

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

Modified files:

Index: src/usr.bin/eject/am_glue.c
diff -u src/usr.bin/eject/am_glue.c:1.1 src/usr.bin/eject/am_glue.c:1.2
--- src/usr.bin/eject/am_glue.c:1.1	Fri Jan 16 12:31:22 2009
+++ src/usr.bin/eject/am_glue.c	Fri Feb 26 15:18:37 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: am_glue.c,v 1.1 2009/01/16 17:31:22 christos Exp $	*/
+/*	$NetBSD: am_glue.c,v 1.2 2010/02/26 20:18:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: am_glue.c,v 1.1 2009/01/16 17:31:22 christos Exp $);
+__RCSID($NetBSD: am_glue.c,v 1.2 2010/02/26 20:18:37 christos Exp $);
 #endif /* not lint */
 
 #ifdef HAVE_CONFIG_H
@@ -36,11 +36,14 @@
 #endif /* HAVE_CONFIG_H */
 #include am_defs.h
 #include amu.h
+#include rpc/pmap_prot.h
+#include rpc/pmap_clnt.h
 
 #include am_glue.h
 
 static CLIENT *clnt;
 
+static struct timeval tv = { 5, 0 };
 /*
  * Appease lint: Properly typecast some numbers defined in
  * src/extern/bsd/am-utils/dist/include/amq_defs.h.
@@ -49,12 +52,45 @@
 #define xAMQ_VERSION		(rpcvers_t)AMQ_VERSION
 #define xAMQPROC_SYNC_UMNT	(rpcproc_t)AMQPROC_SYNC_UMNT
 
+static int
+ping_pmap(void)
+{
+	u_short port = 0;
+	CLIENT *cl;
+	struct pmap parms;
+	struct sockaddr_in si;
+	int s = -1, rv;
+
+	(void)memset(si, 0, sizeof(si));
+	si.sin_family = AF_INET;
+	si.sin_len = sizeof(si);
+	si.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+	si.sin_port = htons(PMAPPORT);
+
+	if ((cl = clntudp_bufcreate(si, PMAPPROG, PMAPVERS, tv,
+	s, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE)) == NULL)
+		return -1;
+
+	parms.pm_prog = PMAPPROG;
+	parms.pm_vers = PMAPVERS;
+	parms.pm_prot = IPPROTO_UDP;
+	parms.pm_port = 0;  /* not needed or used */
+
+	rv = CLNT_CALL(cl, (rpcproc_t)PMAPPROC_GETPORT,
+	(xdrproc_t)xdr_pmap, parms,
+	(xdrproc_t)xdr_u_short, port, tv) == RPC_SUCCESS ? 0 : -1;
+
+	CLNT_DESTROY(cl);
+	return rv;
+}
+
 void
 am_init(void)
 {
-	static struct timeval tv = { 5, 0 };
 	static const char *server = localhost;
 
+	if (ping_pmap() == -1)
+		return;
 	/*
 	 * Create RPC endpoint
 	 */



CVS commit: src/usr.bin/eject

2010-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 20:18:37 UTC 2010

Modified Files:
src/usr.bin/eject: am_glue.c

Log Message:
PR/42207: YAMAMOTO Takashi: If the portmapper (rpcbind) is not running, eject
takes 2 minutes to timeout. Add a ping the portmapper function that times out
after 5 seconds.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/eject/am_glue.c

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



CVS commit: src/distrib/notes/common

2010-02-26 Thread Daniel Horecki
Module Name:src
Committed By:   morr
Date:   Fri Feb 26 21:52:23 UTC 2010

Modified Files:
src/distrib/notes/common: main

Log Message:
Add myself


To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 src/distrib/notes/common/main

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.458 src/distrib/notes/common/main:1.459
--- src/distrib/notes/common/main:1.458	Mon Feb  8 08:32:58 2010
+++ src/distrib/notes/common/main	Fri Feb 26 21:52:22 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: main,v 1.458 2010/02/08 08:32:58 cnst Exp $
+.\	$NetBSD: main,v 1.459 2010/02/26 21:52:22 morr Exp $
 .\
 .\ Copyright (c) 1999-2008 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -1205,6 +1205,7 @@
 .It Ta Jachym Holecek Ta Mt fr...@netbsd.org
 .It Ta David A. Holland Ta Mt dholl...@netbsd.org
 .It Ta Christian E. Hopps Ta Mt cho...@netbsd.org
+.It Ta Daniel Horecki Ta Mt m...@netbsd.org
 .It Ta Ken Hornstein Ta Mt k...@netbsd.org
 .It Ta Marc Horowitz Ta Mt m...@netbsd.org
 .It Ta Eduardo Horvath Ta Mt e...@netbsd.org



CVS commit: src/distrib/notes/common

2010-02-26 Thread Daniel Horecki
Module Name:src
Committed By:   morr
Date:   Fri Feb 26 21:52:23 UTC 2010

Modified Files:
src/distrib/notes/common: main

Log Message:
Add myself


To generate a diff of this commit:
cvs rdiff -u -r1.458 -r1.459 src/distrib/notes/common/main

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



CVS commit: src/sys/kern

2010-02-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Feb 26 22:24:07 UTC 2010

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

Log Message:
mnt_fs_bshift is the filesystem block size, not the fragment size.

Revert to physical block size. This is fine as long as filesystem
and log stay on a similar physical medium.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/vfs_wapbl.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/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.31 src/sys/kern/vfs_wapbl.c:1.32
--- src/sys/kern/vfs_wapbl.c:1.31	Tue Feb 23 20:51:25 2010
+++ src/sys/kern/vfs_wapbl.c	Fri Feb 26 22:24:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.31 2010/02/23 20:51:25 mlelstv Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.32 2010/02/26 22:24:07 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.31 2010/02/23 20:51:25 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_wapbl.c,v 1.32 2010/02/26 22:24:07 mlelstv Exp $);
 
 #include sys/param.h
 #include sys/bitops.h
@@ -319,7 +319,7 @@
 	daddr_t logpbn;
 	int error;
 	int log_dev_bshift = ilog2(blksize);
-	int fs_dev_bshift = mp-mnt_fs_bshift; /* XXX */
+	int fs_dev_bshift = log_dev_bshift;
 	int run;
 
 	WAPBL_PRINTF(WAPBL_PRINT_OPEN, (wapbl_start: vp=%p off=% PRId64



CVS commit: src/sys/kern

2010-02-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Feb 26 22:24:07 UTC 2010

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

Log Message:
mnt_fs_bshift is the filesystem block size, not the fragment size.

Revert to physical block size. This is fine as long as filesystem
and log stay on a similar physical medium.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/kern/vfs_wapbl.c

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




CVS commit: src/usr.bin/eject

2010-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 22:44:17 UTC 2010

Modified Files:
src/usr.bin/eject: am_glue.c

Log Message:
matt wants the ping timeout to be 1sec


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/eject/am_glue.c

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



CVS commit: src/usr.bin/eject

2010-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 22:44:17 UTC 2010

Modified Files:
src/usr.bin/eject: am_glue.c

Log Message:
matt wants the ping timeout to be 1sec


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/eject/am_glue.c

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

Modified files:

Index: src/usr.bin/eject/am_glue.c
diff -u src/usr.bin/eject/am_glue.c:1.2 src/usr.bin/eject/am_glue.c:1.3
--- src/usr.bin/eject/am_glue.c:1.2	Fri Feb 26 15:18:37 2010
+++ src/usr.bin/eject/am_glue.c	Fri Feb 26 17:44:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: am_glue.c,v 1.2 2010/02/26 20:18:37 christos Exp $	*/
+/*	$NetBSD: am_glue.c,v 1.3 2010/02/26 22:44:17 christos Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: am_glue.c,v 1.2 2010/02/26 20:18:37 christos Exp $);
+__RCSID($NetBSD: am_glue.c,v 1.3 2010/02/26 22:44:17 christos Exp $);
 #endif /* not lint */
 
 #ifdef HAVE_CONFIG_H
@@ -60,6 +60,7 @@
 	struct pmap parms;
 	struct sockaddr_in si;
 	int s = -1, rv;
+	static struct timeval pingtv = { 1, 0 };
 
 	(void)memset(si, 0, sizeof(si));
 	si.sin_family = AF_INET;
@@ -67,7 +68,7 @@
 	si.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
 	si.sin_port = htons(PMAPPORT);
 
-	if ((cl = clntudp_bufcreate(si, PMAPPROG, PMAPVERS, tv,
+	if ((cl = clntudp_bufcreate(si, PMAPPROG, PMAPVERS, pingtv,
 	s, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE)) == NULL)
 		return -1;
 
@@ -78,7 +79,7 @@
 
 	rv = CLNT_CALL(cl, (rpcproc_t)PMAPPROC_GETPORT,
 	(xdrproc_t)xdr_pmap, parms,
-	(xdrproc_t)xdr_u_short, port, tv) == RPC_SUCCESS ? 0 : -1;
+	(xdrproc_t)xdr_u_short, port, pingtv) == RPC_SUCCESS ? 0 : -1;
 
 	CLNT_DESTROY(cl);
 	return rv;



CVS commit: src/sys/dev/dm

2010-02-26 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Feb 26 23:52:43 UTC 2010

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
Use correct prototype for dmattach().


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/device-mapper.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.17 src/sys/dev/dm/device-mapper.c:1.18
--- src/sys/dev/dm/device-mapper.c:1.17	Thu Feb 25 23:37:39 2010
+++ src/sys/dev/dm/device-mapper.c	Fri Feb 26 23:52:43 2010
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.17 2010/02/25 23:37:39 haad Exp $ */
+/*$NetBSD: device-mapper.c,v 1.18 2010/02/26 23:52:43 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -46,7 +46,6 @@
 #include sys/ioccom.h
 #include sys/kmem.h
 #include sys/module.h
-#include sys/once.h
 
 #include netbsd-dm.h
 #include dm.h
@@ -60,9 +59,10 @@
 static dev_type_size(dmsize);
 
 /* attach and detach routines */
-int dmattach(void);
+void dmattach(int);
 int dmdestroy(void);
 
+static int doinit(void);
 static int dm_cmd_to_fun(prop_dictionary_t);
 static int disk_ioctl_switch(dev_t, u_long, void *);
 static int dm_ioctl_switch(u_long);
@@ -161,11 +161,9 @@
 		if (error)
 			break;
 
-		error = dmattach();
+		error = doinit();
 		if (error) {
 			config_cfdriver_detach(dm_cd);
-			aprint_error(%s: unable to register cfattach\n,
-			dm_cd.cd_name);
 			break;
 		}
 
@@ -278,7 +276,8 @@
 	
 	error = config_cfattach_attach(dm_cd.cd_name, dm_ca);
 	if (error) {
-		aprint_error(Unable to register cfattach for dm driver\n);
+		aprint_error(%s: unable to register cfattach\n,
+		dm_cd.cd_name);
 		return error;
 	}
 	
@@ -290,12 +289,10 @@
 }
 
 /* attach routine */
-int
-dmattach(void)
+void
+dmattach(int n)
 {
-	static ONCE_DECL(control);
-
-	return RUN_ONCE(control, doinit);
+	doinit();
 }
 
 /* Destroy routine */



CVS commit: src/sys/dev/dm

2010-02-26 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Feb 26 23:52:43 UTC 2010

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
Use correct prototype for dmattach().


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/device-mapper.c

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



CVS commit: src/sys/dev/dm

2010-02-26 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Feb 27 00:31:57 UTC 2010

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
Use RUN_ONCE(9) again.  (Everyone happy now?)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dm/device-mapper.c

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



CVS commit: src/sys/dev/dm

2010-02-26 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Feb 27 00:31:57 UTC 2010

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
Use RUN_ONCE(9) again.  (Everyone happy now?)


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/dm/device-mapper.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.18 src/sys/dev/dm/device-mapper.c:1.19
--- src/sys/dev/dm/device-mapper.c:1.18	Fri Feb 26 23:52:43 2010
+++ src/sys/dev/dm/device-mapper.c	Sat Feb 27 00:31:57 2010
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.18 2010/02/26 23:52:43 jakllsch Exp $ */
+/*$NetBSD: device-mapper.c,v 1.19 2010/02/27 00:31:57 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -46,6 +46,7 @@
 #include sys/ioccom.h
 #include sys/kmem.h
 #include sys/module.h
+#include sys/once.h
 
 #include netbsd-dm.h
 #include dm.h
@@ -62,7 +63,9 @@
 void dmattach(int);
 int dmdestroy(void);
 
+static ONCE_DECL(doinit_control);
 static int doinit(void);
+
 static int dm_cmd_to_fun(prop_dictionary_t);
 static int disk_ioctl_switch(dev_t, u_long, void *);
 static int dm_ioctl_switch(u_long);
@@ -161,7 +164,7 @@
 		if (error)
 			break;
 
-		error = doinit();
+		error = RUN_ONCE(doinit_control, doinit);
 		if (error) {
 			config_cfdriver_detach(dm_cd);
 			break;
@@ -292,7 +295,7 @@
 void
 dmattach(int n)
 {
-	doinit();
+	RUN_ONCE(doinit_control, doinit);
 }
 
 /* Destroy routine */



CVS commit: src/sys/dev/ic

2010-02-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 27 04:36:57 UTC 2010

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

Log Message:
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/ic/dp8390.c

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



CVS commit: src/sys/dev/ic

2010-02-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 27 04:36:57 UTC 2010

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

Log Message:
Also fix a wrong mem_ring calculation in dp8390_ipkdb_attach().


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/ic/dp8390.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/dp8390.c
diff -u src/sys/dev/ic/dp8390.c:1.74 src/sys/dev/ic/dp8390.c:1.75
--- src/sys/dev/ic/dp8390.c:1.74	Wed Feb 24 13:10:26 2010
+++ src/sys/dev/ic/dp8390.c	Sat Feb 27 04:36:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp8390.c,v 1.74 2010/02/24 13:10:26 tsutsui Exp $	*/
+/*	$NetBSD: dp8390.c,v 1.75 2010/02/27 04:36:56 tsutsui Exp $	*/
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -14,7 +14,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dp8390.c,v 1.74 2010/02/24 13:10:26 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dp8390.c,v 1.75 2010/02/27 04:36:56 tsutsui Exp $);
 
 #include opt_ipkdb.h
 #include opt_inet.h
@@ -1304,7 +1304,8 @@
 	sc-tx_page_start = sc-mem_start  ED_PAGE_SHIFT;
 	sc-rec_page_start = sc-tx_page_start + sc-txb_cnt * ED_TXBUF_SIZE;
 	sc-rec_page_stop = sc-tx_page_start + (sc-mem_size  ED_PAGE_SHIFT);
-	sc-mem_ring = sc-mem_start + (sc-rec_page_start  ED_PAGE_SHIFT);
+	sc-mem_ring = sc-mem_start +
+	((sc-txb_cnt * ED_TXBUF_SIZE)  ED_PAGE_SHIFT);
 	sc-mem_end = sc-mem_start + sc-mem_size;
 
 	dp8390_stop(sc);



CVS commit: src/sys/dev/ic

2010-02-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 27 04:40:12 UTC 2010

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

Log Message:
Always call device dependent functions via pointers rather than
using conditionals to switch inline functions for modern processors.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/ic/dp8390.c

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



CVS commit: src/sys/dev/ic

2010-02-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 27 04:40:12 UTC 2010

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

Log Message:
Always call device dependent functions via pointers rather than
using conditionals to switch inline functions for modern processors.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/ic/dp8390.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/dp8390.c
diff -u src/sys/dev/ic/dp8390.c:1.75 src/sys/dev/ic/dp8390.c:1.76
--- src/sys/dev/ic/dp8390.c:1.75	Sat Feb 27 04:36:56 2010
+++ src/sys/dev/ic/dp8390.c	Sat Feb 27 04:40:11 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp8390.c,v 1.75 2010/02/27 04:36:56 tsutsui Exp $	*/
+/*	$NetBSD: dp8390.c,v 1.76 2010/02/27 04:40:11 tsutsui Exp $	*/
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -14,7 +14,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dp8390.c,v 1.75 2010/02/27 04:36:56 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dp8390.c,v 1.76 2010/02/27 04:40:11 tsutsui Exp $);
 
 #include opt_ipkdb.h
 #include opt_inet.h
@@ -61,17 +61,16 @@
 #include dev/ic/dp8390var.h
 
 #ifdef DEBUG
-#define inline	/* XXX for debugging porpoises */
 int	dp8390_debug = 0;
 #endif
 
-static inline void	dp8390_xmit(struct dp8390_softc *);
+static void		dp8390_xmit(struct dp8390_softc *);
 
-static inline void	dp8390_read_hdr(struct dp8390_softc *,
+static void		dp8390_read_hdr(struct dp8390_softc *,
 			int, struct dp8390_ring *);
-static inline int	dp8390_ring_copy(struct dp8390_softc *,
+static int		dp8390_ring_copy(struct dp8390_softc *,
 			int, void *, u_short);
-static inline int	dp8390_write_mbuf(struct dp8390_softc *,
+static int		dp8390_write_mbuf(struct dp8390_softc *,
 			struct mbuf *, int);
 
 static int		dp8390_test_mem(struct dp8390_softc *);
@@ -99,8 +98,16 @@
 
 	rv = 1;
 
-	if (!sc-test_mem)
+	if (sc-test_mem == NULL)
 		sc-test_mem = dp8390_test_mem;
+	if (sc-read_hdr == NULL)
+		sc-read_hdr = dp8390_read_hdr;
+	if (sc-recv_int == NULL)
+		sc-recv_int = dp8390_rint;
+	if (sc-ring_copy == NULL)
+		sc-ring_copy = dp8390_ring_copy;
+	if (sc-write_mbuf == NULL)
+		sc-write_mbuf = dp8390_write_mbuf;
 
 	/* Allocate one xmit buffer if  16k, two buffers otherwise. */
 	if ((sc-mem_size  16384) ||
@@ -394,7 +401,7 @@
 /*
  * This routine actually starts the transmission on the interface.
  */
-static inline void
+static void
 dp8390_xmit(struct dp8390_softc *sc)
 {
 	bus_space_tag_t regt = sc-sc_regt;
@@ -483,10 +490,7 @@
 	buffer = sc-mem_start +
 	((sc-txb_new * ED_TXBUF_SIZE)  ED_PAGE_SHIFT);
 
-	if (sc-write_mbuf)
-		len = (*sc-write_mbuf)(sc, m0, buffer);
-	else
-		len = dp8390_write_mbuf(sc, m0, buffer);
+	len = (*sc-write_mbuf)(sc, m0, buffer);
 
 	m_freem(m0);
 	sc-txb_len[sc-txb_new] = len;
@@ -547,10 +551,7 @@
 		packet_ptr = sc-mem_ring +
 		((sc-next_packet - sc-rec_page_start)  ED_PAGE_SHIFT);
 
-		if (sc-read_hdr)
-			(*sc-read_hdr)(sc, packet_ptr, packet_hdr);
-		else
-			dp8390_read_hdr(sc, packet_ptr, packet_hdr);
+		(*sc-read_hdr)(sc, packet_ptr, packet_hdr);
 		len = packet_hdr.count;
 
 		/*
@@ -791,10 +792,7 @@
  * (we've configured the interface to not
  * accept packets with errors).
  */
-if (sc-recv_int)
-	(*sc-recv_int)(sc);
-else
-	dp8390_rint(sc);
+(*sc-recv_int)(sc);
 			}
 		}
 
@@ -1077,10 +1075,7 @@
 		}
 
 		m-m_len = len = min(total_len, len);
-		if (sc-ring_copy)
-			src = (*sc-ring_copy)(sc, src, mtod(m, void *), len);
-		else
-			src = dp8390_ring_copy(sc, src, mtod(m, void *), len);
+		src = (*sc-ring_copy)(sc, src, mtod(m, void *), len);
 
 		total_len -= len;
 		if (total_len  0) {
@@ -1131,7 +1126,7 @@
 /*
  * Read a packet header from the ring, given the source offset.
  */
-static inline void
+static void
 dp8390_read_hdr(struct dp8390_softc *sc, int src, struct dp8390_ring *hdrp)
 {
 	bus_space_tag_t buft = sc-sc_buft;
@@ -1152,7 +1147,7 @@
  * destination buffer, given a source offset and destination address.
  * Takes into account ring-wrap.
  */
-static inline int
+static int
 dp8390_ring_copy(struct dp8390_softc *sc, int src, void *dst, u_short amount)
 {
 	bus_space_tag_t buft = sc-sc_buft;
@@ -1181,7 +1176,7 @@
  * Currently uses an extra buffer/extra memory copy, unless the whole
  * packet fits in one mbuf.
  */
-static inline int
+static int
 dp8390_write_mbuf(struct dp8390_softc *sc, struct mbuf *m, int buf)
 {
 	bus_space_tag_t buft = sc-sc_buft;



CVS commit: src/sys/dev/ic

2010-02-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 27 05:41:22 UTC 2010

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

Log Message:
KNF, misc cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ic/dp8390.c

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



CVS commit: src/sys/dev/ic

2010-02-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 27 05:41:22 UTC 2010

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

Log Message:
KNF, misc cosmetics.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/ic/dp8390.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/dp8390.c
diff -u src/sys/dev/ic/dp8390.c:1.76 src/sys/dev/ic/dp8390.c:1.77
--- src/sys/dev/ic/dp8390.c:1.76	Sat Feb 27 04:40:11 2010
+++ src/sys/dev/ic/dp8390.c	Sat Feb 27 05:41:22 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp8390.c,v 1.76 2010/02/27 04:40:11 tsutsui Exp $	*/
+/*	$NetBSD: dp8390.c,v 1.77 2010/02/27 05:41:22 tsutsui Exp $	*/
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -14,7 +14,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dp8390.c,v 1.76 2010/02/27 04:40:11 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dp8390.c,v 1.77 2010/02/27 05:41:22 tsutsui Exp $);
 
 #include opt_ipkdb.h
 #include opt_inet.h
@@ -64,16 +64,13 @@
 int	dp8390_debug = 0;
 #endif
 
-static void		dp8390_xmit(struct dp8390_softc *);
+static void dp8390_xmit(struct dp8390_softc *);
 
-static void		dp8390_read_hdr(struct dp8390_softc *,
-			int, struct dp8390_ring *);
-static int		dp8390_ring_copy(struct dp8390_softc *,
-			int, void *, u_short);
-static int		dp8390_write_mbuf(struct dp8390_softc *,
-			struct mbuf *, int);
+static void dp8390_read_hdr(struct dp8390_softc *, int, struct dp8390_ring *);
+static int  dp8390_ring_copy(struct dp8390_softc *, int, void *, u_short);
+static int  dp8390_write_mbuf(struct dp8390_softc *, struct mbuf *, int);
 
-static int		dp8390_test_mem(struct dp8390_softc *);
+static int  dp8390_test_mem(struct dp8390_softc *);
 
 /*
  * Standard media init routine for the dp8390.
@@ -137,7 +134,7 @@
 	ifp-if_softc = sc;
 	ifp-if_start = dp8390_start;
 	ifp-if_ioctl = dp8390_ioctl;
-	if (!ifp-if_watchdog)
+	if (ifp-if_watchdog == NULL)
 		ifp-if_watchdog = dp8390_watchdog;
 	ifp-if_flags =
 	IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
@@ -168,8 +165,8 @@
 	sc-sc_flags |= DP8390_ATTACHED;
 
 	rv = 0;
-out:
-	return (rv);
+ out:
+	return rv;
 }
 
 /*
@@ -181,8 +178,8 @@
 	struct dp8390_softc *sc = ifp-if_softc;
 
 	if (sc-sc_mediachange)
-		return ((*sc-sc_mediachange)(sc));
-	return (0);
+		return (*sc-sc_mediachange)(sc);
+	return 0;
 }
 
 /*
@@ -209,7 +206,7 @@
 void
 dp8390_reset(struct dp8390_softc *sc)
 {
-	int s;
+	int s;
 
 	s = splnet();
 	dp8390_stop(sc);
@@ -238,8 +235,7 @@
 	 * 'n' (about 5ms).  It shouldn't even take 5us on modern DS8390's, but
 	 * just in case it's an old one.
 	 */
-	while (((NIC_GET(regt, regh,
-	ED_P0_ISR)  ED_ISR_RST) == 0)  --n)
+	while (((NIC_GET(regt, regh, ED_P0_ISR)  ED_ISR_RST) == 0)  --n)
 		DELAY(1);
 
 	if (sc-stop_card != NULL)
@@ -271,7 +267,7 @@
 	bus_space_tag_t regt = sc-sc_regt;
 	bus_space_handle_t regh = sc-sc_regh;
 	struct ifnet *ifp = sc-sc_ec.ec_if;
-	u_int8_t mcaf[8];
+	uint8_t mcaf[8];
 	int i;
 
 	/*
@@ -345,9 +341,8 @@
 	NIC_BARRIER(regt, regh);
 
 	/* Copy out our station address. */
-	for (i = 0; i  ETHER_ADDR_LEN; ++i)
-		NIC_PUT(regt, regh, ED_P1_PAR0 + i,
-		CLLADDR(ifp-if_sadl)[i]);
+	for (i = 0; i  ETHER_ADDR_LEN; i++)
+		NIC_PUT(regt, regh, ED_P1_PAR0 + i, CLLADDR(ifp-if_sadl)[i]);
 
 	/* Set multicast filter on chip. */
 	dp8390_getmcaf(sc-sc_ec, mcaf);
@@ -382,7 +377,7 @@
 	NIC_PUT(regt, regh, ED_P0_TCR, 0);
 
 	/* Do any card-specific initialization, if applicable. */
-	if (sc-init_card)
+	if (sc-init_card != NULL)
 		(*sc-init_card)(sc);
 
 	/* Fire up the interface. */
@@ -427,8 +422,8 @@
 	NIC_BARRIER(regt, regh);
 
 	/* Set TX buffer start page. */
-	NIC_PUT(regt, regh, ED_P0_TPSR, sc-tx_page_start +
-	sc-txb_next_tx * ED_TXBUF_SIZE);
+	NIC_PUT(regt, regh, ED_P0_TPSR,
+	sc-tx_page_start + sc-txb_next_tx * ED_TXBUF_SIZE);
 
 	/* Set TX length. */
 	NIC_PUT(regt, regh, ED_P0_TBCR0, len);
@@ -467,7 +462,7 @@
 	if ((ifp-if_flags  (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
 		return;
 
-outloop:
+ outloop:
 	/* See if there is room to put another packet in the buffer. */
 	if (sc-txb_inuse == sc-txb_cnt) {
 		/* No room.  Indicate this to the outside world and exit. */
@@ -475,7 +470,7 @@
 		return;
 	}
 	IFQ_DEQUEUE(ifp-if_snd, m0);
-	if (m0 == 0)
+	if (m0 == NULL)
 		return;
 
 	/* We need to use m-m_pkthdr.len, so require the header */
@@ -517,11 +512,11 @@
 	bus_space_handle_t regh = sc-sc_regh;
 	struct dp8390_ring packet_hdr;
 	int packet_ptr;
-	u_short len;
-	u_char boundary, current;
-	u_char nlen;
+	uint16_t len;
+	uint8_t boundary, current;
+	uint8_t nlen;
 
-loop:
+ loop:
 	/* Set NIC to page 1 registers to get 'current' pointer. */
 	NIC_BARRIER(regt, regh);
 	NIC_PUT(regt, regh, ED_P0_CR,
@@ -628,18 +623,18 @@
 int
 dp8390_intr(void *arg)
 {
-	struct dp8390_softc *sc = (struct dp8390_softc *)arg;
+	struct 

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

2010-02-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 27 07:52:25 UTC 2010

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

Log Message:
Add the RMI COP0 OSSCRATCH register


To generate a diff of this commit:
cvs rdiff -u -r1.74.28.14 -r1.74.28.15 src/sys/arch/mips/include/cpuregs.h

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



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

2010-02-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 27 07:58:53 UTC 2010

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips
src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h locore.h pmap.h
src/sys/arch/mips/mips [matt-nb5-mips64]: mipsX_subr.S mips_machdep.c
pmap.c pmap_tlb.c
Added Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_fixup.c

Log Message:
Add mipsXX_tlb_enter which modifies/sets a specific TLB entry with a new
mapping (useful for wired TLB entries).
Add mips_fixup_exceptions which will walk through the exception vectors
and allows the fixup of any cpu_info references to be changed to a more
MP-friendly incarnation.
Define a common fixup method to use a wired TLB entry at -PAGE_SIZE allowing
direct loads using a negative based from the zero register.
Change varible pmap_tlb_info t pmap_tlb0_info.


To generate a diff of this commit:
cvs rdiff -u -r1.58.24.8 -r1.58.24.9 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r1.90.16.22 -r1.90.16.23 src/sys/arch/mips/include/cpu.h
cvs rdiff -u -r1.78.36.1.2.15 -r1.78.36.1.2.16 \
src/sys/arch/mips/include/locore.h
cvs rdiff -u -r1.54.26.10 -r1.54.26.11 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.26.36.1.2.26 -r1.26.36.1.2.27 \
src/sys/arch/mips/mips/mipsX_subr.S
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/mips/mips_fixup.c
cvs rdiff -u -r1.205.4.1.2.1.2.36 -r1.205.4.1.2.1.2.37 \
src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.179.16.18 -r1.179.16.19 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/mips/pmap_tlb.c

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