CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2010-01-26 Thread Jeremy Morse
Module Name:src
Committed By:   jmorse
Date:   Tue Jan 26 08:01:27 UTC 2010

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: drmP.h drm_bufs.c drm_memory.c

Log Message:
PR/42262: Support drm drivers (intel G33/G45) submapping pci resources


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/external/bsd/drm/dist/bsd-core/drmP.h
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm/dist/bsd-core/drm_bufs.c \
src/sys/external/bsd/drm/dist/bsd-core/drm_memory.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/external/bsd/drm/dist/bsd-core/drmP.h
diff -u src/sys/external/bsd/drm/dist/bsd-core/drmP.h:1.15 src/sys/external/bsd/drm/dist/bsd-core/drmP.h:1.16
--- src/sys/external/bsd/drm/dist/bsd-core/drmP.h:1.15	Sun Dec  6 22:51:25 2009
+++ src/sys/external/bsd/drm/dist/bsd-core/drmP.h	Tue Jan 26 08:01:26 2010
@@ -658,6 +658,18 @@
 
 typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t;
 
+#if defined(__NetBSD__)
+typedef struct {
+	int			mapped;
+	int			maptype;
+	bus_addr_t		base;
+	bus_size_t		size;
+	bus_space_handle_t	bsh;
+	int			flags;
+	void *			vaddr;
+} pci_map_data_t;
+#endif
+
 typedef struct drm_local_map {
 	unsigned long	offset;	 /* Physical address (0 for SAREA)*/
 	unsigned long	size;	 /* Physical size (bytes)	*/
@@ -675,7 +687,7 @@
 	bus_space_handle_t bsh;
 	drm_dma_handle_t *dmah;
 #if defined(__NetBSD__)
-	int *cnt;
+	pci_map_data_t *fullmap;
 	bus_size_t mapsize;
 #endif
 	TAILQ_ENTRY(drm_local_map) link;
@@ -792,18 +804,6 @@
 /* Length for the array of resource pointers for drm_get_resource_*. */
 #define DRM_MAX_PCI_RESOURCE	6
 
-#if defined(__NetBSD__)
-typedef struct {
-	int			mapped;
-	int			maptype;
-	bus_addr_t		base;
-	bus_size_t		size;
-	bus_space_handle_t	bsh;
-	int			flags;
-	void *			vaddr;
-} pci_map_data_t;
-#endif
-
 /** 
  * DRM device functions structure
  */

Index: src/sys/external/bsd/drm/dist/bsd-core/drm_bufs.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_bufs.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/drm_bufs.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/drm_bufs.c:1.6	Wed Sep  2 01:36:41 2009
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_bufs.c	Tue Jan 26 08:01:26 2010
@@ -159,16 +159,25 @@
 	map-size = size;
 	map-type = type;
 	map-flags = flags;
-#ifdef __NetBSD__
-	map-cnt = NULL;
+#if defined(__NetBSD__)
+	map-fullmap = NULL;
 	map-mapsize = 0;
 #endif
 
 	switch (map-type) {
 	case _DRM_REGISTERS:
 		map-handle = drm_ioremap(dev, map);
+		if (map-handle == NULL) {
+			DRM_ERROR(drm_addmap couldn't ioremap registers with 
+base %lX, size %lX\n,
+(long) offset, (long) size);
+			DRM_LOCK();
+			return EINVAL;
+		}
+
 		if (!(map-flags  _DRM_WRITE_COMBINING))
 			break;
+
 		/* FALLTHROUGH */
 	case _DRM_FRAME_BUFFER:
 		if (drm_mtrr_add(map-offset, map-size, DRM_MTRR_WC) == 0)
Index: src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c:1.6 src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c:1.7
--- src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c:1.6	Wed Sep  2 01:36:41 2009
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_memory.c	Tue Jan 26 08:01:26 2010
@@ -85,29 +85,55 @@
 static void *
 drm_netbsd_ioremap(struct drm_device *dev, drm_local_map_t *map, int wc)
 {
+	bus_space_handle_t h;
 	int i, reg, reason;
 	for(i = 0; iDRM_MAX_PCI_RESOURCE; i++) {
 		reg = PCI_MAPREG_START + i*4;
+
+		/* Does the requested mapping lie within this resource? */
 		if ((dev-pci_map_data[i].maptype == PCI_MAPREG_TYPE_MEM ||
 		 dev-pci_map_data[i].maptype ==
   (PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT)) 
-		dev-pci_map_data[i].base == map-offset 
-		dev-pci_map_data[i].size = map-size)
+		map-offset = dev-pci_map_data[i].base 
+		map-offset + map-size = dev-pci_map_data[i].base +
+  dev-pci_map_data[i].size)
 		{
 			map-bst = dev-pa.pa_memt;
-			map-cnt = (dev-pci_map_data[i].mapped);
-			map-mapsize = dev-pci_map_data[i].size;
+			map-fullmap = (dev-pci_map_data[i]);
+			map-mapsize = map-size;
 			dev-pci_map_data[i].mapped++;
+
+			/* If we've already mapped this resource in, handle
+			 * submapping if needed, give caller a bus_space handle
+			 * and pointer for the offest they asked for */
 			if (dev-pci_map_data[i].mapped  1)
 			{
-map-bsh = dev-pci_map_data[i].bsh;
-return dev-pci_map_data[i].vaddr;
+if ((reason = bus_space_subregion(
+		dev-pa.pa_memt,
+		dev-pci_map_data[i].bsh,
+		map-offset - dev-pci_map_data[i].base,
+		map-size, h)) != 0)  {
+	DRM_DEBUG(ioremap failed to 
+		bus_space_subregion: %d\n,
+		reason);
+	return NULL;
+}
+map-bsh = h;
+map-handle = bus_space_vaddr(dev-pa.pa_memt,
+	h);
+return map-handle;
 			}
+
+			/* Map in entirety 

CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 08:14:09 UTC 2010

Modified Files:
src/share/man/man9: Makefile

Log Message:
Build links for rest of the sysmon_taskq(9) functions.


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 src/share/man/man9/Makefile

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/Makefile
diff -u src/share/man/man9/Makefile:1.311 src/share/man/man9/Makefile:1.312
--- src/share/man/man9/Makefile:1.311	Mon Jan 25 16:16:33 2010
+++ src/share/man/man9/Makefile	Tue Jan 26 08:14:09 2010
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.311 2010/01/25 16:16:33 jruoho Exp $
+#   $NetBSD: Makefile,v 1.312 2010/01/26 08:14:09 jruoho Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -659,7 +659,10 @@
 	sysmon_envsys.9 sysmon_envsys_unregister.9 \
 	sysmon_envsys.9 sysmon_envsys_sensor_attach.9 \
 	sysmon_envsys.9 sysmon_envsys_sensor_detach.9
-MLINKS+=sysmon_taskq.9 sysmon_task_queue_sched.9
+MLINKS+=sysmon_taskq.9 sysmon_task_queue_fini.9 \
+	sysmon_taskq.9 sysmon_task_queue_init.9 \
+	sysmon_taskq.9 sysmon_task_queue_preinit.9 \
+	sysmon_taskq.9 sysmon_task_queue_sched.9
 MLINKS+=time_second.9 boottime.9 time_second.9 time_uptime.9
 MLINKS+=timecounter.9 tc_init.9
 MLINKS+=tc.9 tc_intr_establish.9 \



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

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 08:30:21 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Include all references from sysmon_taskq(9).


To generate a diff of this commit:
cvs rdiff -u -r1.1376 -r1.1377 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1376 src/distrib/sets/lists/comp/mi:1.1377
--- src/distrib/sets/lists/comp/mi:1.1376	Mon Jan 25 16:17:10 2010
+++ src/distrib/sets/lists/comp/mi	Tue Jan 26 08:30:20 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1376 2010/01/25 16:17:10 jruoho Exp $
+#	$NetBSD: mi,v 1.1377 2010/01/26 08:30:20 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -9377,6 +9377,9 @@
 ./usr/share/man/cat9/sysmon_envsys_sensor_detach.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_envsys_unregister.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_taskq.0		comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_task_queue_fini.0	comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_task_queue_init.0	comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_task_queue_preinit.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_task_queue_sched.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/tc.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/tc_badaddr.0		comp-sys-catman		.cat
@@ -14902,6 +14905,9 @@
 ./usr/share/man/html9/sysmon_envsys_sensor_detach.html	comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_envsys_unregister.html	comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_taskq.html		comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_task_queue_fini.html	comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_task_queue_init.html	comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_task_queue_preinit.html	comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_task_queue_sched.html	comp-sys-htmlman	html
 ./usr/share/man/html9/tc.html			comp-sys-htmlman	html
 ./usr/share/man/html9/tc_badaddr.html		comp-sys-htmlman	html
@@ -20634,6 +20640,9 @@
 ./usr/share/man/man9/sysmon_envsys_sensor_detach.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_envsys_unregister.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_taskq.9		comp-sys-man		.man
+./usr/share/man/man9/sysmon_task_queue_fini.9	comp-sys-man		.man
+./usr/share/man/man9/sysmon_task_queue_init.9	comp-sys-man		.man
+./usr/share/man/man9/sysmon_task_queue_preinit.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_task_queue_sched.9	comp-sys-man		.man
 ./usr/share/man/man9/tc.9			comp-sys-man		.man
 ./usr/share/man/man9/tc_badaddr.9		comp-sys-man		.man



CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils/bfd

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 26 08:40:49 UTC 2010

Modified Files:
src/gnu/dist/binutils/bfd [matt-nb5-mips64]: elfn32-mips.c

Log Message:
Add a is_local_label_name function so that objcopy/strip can strip out
local symbols of a N32 image.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.32.1 src/gnu/dist/binutils/bfd/elfn32-mips.c

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

Modified files:

Index: src/gnu/dist/binutils/bfd/elfn32-mips.c
diff -u src/gnu/dist/binutils/bfd/elfn32-mips.c:1.1.1.3 src/gnu/dist/binutils/bfd/elfn32-mips.c:1.1.1.3.32.1
--- src/gnu/dist/binutils/bfd/elfn32-mips.c:1.1.1.3	Thu Feb  2 20:47:37 2006
+++ src/gnu/dist/binutils/bfd/elfn32-mips.c	Tue Jan 26 08:40:49 2010
@@ -81,6 +81,8 @@
   (bfd *, Elf_Internal_Note *);
 static bfd_boolean elf32_mips_grok_psinfo
   (bfd *, Elf_Internal_Note *);
+static bfd_boolean mips_elf_n32_is_local_label_name
+  (bfd *, const char *);
 static irix_compat_t elf_n32_mips_irix_compat
   (bfd *);
 
@@ -2239,6 +2241,17 @@
   return TRUE;
 }
 
+/* MIPS ELF local labels start with $L.  */
+static bfd_boolean
+mips_elf_n32_is_local_label_name (bfd *abfd, const char *name)
+{
+  if (name[0] == '$'  name[1] == 'L')
+return TRUE;
+
+  /* We accept the generic ELF local label syntax as well.  */
+  return _bfd_elf_is_local_label_name (abfd, name);
+}
+
 /* Depending on the target vector we generate some version of Irix
executables or normal MIPS ELF ABI executables.  */
 static irix_compat_t
@@ -2355,6 +2368,8 @@
 #define elf_backend_write_section	_bfd_mips_elf_write_section
 #define elf_backend_mips_irix_compat	elf_n32_mips_irix_compat
 #define elf_backend_mips_rtype_to_howto	mips_elf_n32_rtype_to_howto
+#define bfd_elf32_bfd_is_local_label_name \
+mips_elf_n32_is_local_label_name
 #define bfd_elf32_find_nearest_line	_bfd_mips_elf_find_nearest_line
 #define bfd_elf32_new_section_hook	_bfd_mips_elf_new_section_hook
 #define bfd_elf32_set_section_contents	_bfd_mips_elf_set_section_contents



CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 08:48:39 UTC 2010

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

Log Message:
Mention that all tasks are executed before the halt.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/share/man/man9/sysmon_taskq.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/sysmon_taskq.9
diff -u src/share/man/man9/sysmon_taskq.9:1.5 src/share/man/man9/sysmon_taskq.9:1.6
--- src/share/man/man9/sysmon_taskq.9:1.5	Tue Jan 26 07:58:16 2010
+++ src/share/man/man9/sysmon_taskq.9	Tue Jan 26 08:48:39 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: sysmon_taskq.9,v 1.5 2010/01/26 07:58:16 jruoho Exp $
+.\ $NetBSD: sysmon_taskq.9,v 1.6 2010/01/26 08:48:39 jruoho Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -63,6 +63,7 @@
 .Fn sysmon_task_queue_init .
 This will create a kernel thread that can be later halted by
 .Fn sysmon_task_queue_fini .
+All scheduled tasks are executed before the queue is halted.
 .Pp
 The
 .Fn sysmon_task_queue_sched



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

2010-01-26 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Jan 26 12:45:46 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: md.amd64

Log Message:
Convert remaining base-obsolete to comp-obsolete.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/distrib/sets/lists/comp/md.amd64

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/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.61 src/distrib/sets/lists/comp/md.amd64:1.62
--- src/distrib/sets/lists/comp/md.amd64:1.61	Thu Jan 14 12:01:58 2010
+++ src/distrib/sets/lists/comp/md.amd64	Tue Jan 26 12:45:46 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.61 2010/01/14 12:01:58 wiz Exp $
+# $NetBSD: md.amd64,v 1.62 2010/01/26 12:45:46 njoly Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -659,7 +659,7 @@
 ./usr/lib/i386/libstdc++_p.a			comp-c-proflib		compat,profile,cxx
 ./usr/lib/i386/libstdc++_pic.a			comp-c-piclib		compat,pic,cxx
 ./usr/lib/i386/libsupc++.a			comp-c-lib		compat,cxx
-./usr/lib/i386/libsupc++.so			base-obsolete		obsolete
+./usr/lib/i386/libsupc++.so			comp-obsolete		obsolete
 ./usr/lib/i386/libsupc++_pic.a			comp-obsolete		obsolete
 ./usr/lib/i386/libtermcap.a			comp-c-lib		compat
 ./usr/lib/i386/libtermcap.so			comp-sys-shlib		compat,pic



CVS commit: src/sys/kern

2010-01-26 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Tue Jan 26 12:59:51 UTC 2010

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

Log Message:
On a recursive panic(), don't try to take a dump, as that may very
well have triggered the recursive panic.
Fix the comment for panic() to reflect now-current reality: the code
was already changed never to sync() on panic(), now we avoid dumping
core on a recursive panic.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/kern/subr_prf.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_prf.c
diff -u src/sys/kern/subr_prf.c:1.137 src/sys/kern/subr_prf.c:1.138
--- src/sys/kern/subr_prf.c:1.137	Tue Nov  3 05:23:28 2009
+++ src/sys/kern/subr_prf.c	Tue Jan 26 12:59:50 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.137 2009/11/03 05:23:28 dyoung Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.138 2010/01/26 12:59:50 he Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.137 2009/11/03 05:23:28 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.138 2010/01/26 12:59:50 he Exp $);
 
 #include opt_ddb.h
 #include opt_ipkdb.h
@@ -202,8 +202,7 @@
  * panic: handle an unresolvable fatal error
  *
  * prints panic: message and reboots.   if called twice (i.e. recursive
- * call) we avoid trying to sync the disk and just reboot (to avoid
- * recursive panics).
+ * call) we avoid trying to dump and just reboot (to avoid recursive panics).
  */
 
 void
@@ -246,8 +245,12 @@
 	}
 
 	bootopt = RB_AUTOBOOT | RB_NOSYNC;
-	if (dumponpanic)
-		bootopt |= RB_DUMP;
+	if (!doing_shutdown) {
+		if (dumponpanic)
+			bootopt |= RB_DUMP;
+	} else
+		printf(Skipping crash dump on recursive panic\n);
+
 	if (!panicstr)
 		panicstr = fmt;
 	doing_shutdown = 1;



CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 14:00:38 UTC 2010

Modified Files:
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: sysmon_pswitch.9

Log Message:
Document also the sysmon power switches; sysmon_pswitch(9).


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/sysmon_pswitch.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/Makefile
diff -u src/share/man/man9/Makefile:1.312 src/share/man/man9/Makefile:1.313
--- src/share/man/man9/Makefile:1.312	Tue Jan 26 08:14:09 2010
+++ src/share/man/man9/Makefile	Tue Jan 26 14:00:38 2010
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.312 2010/01/26 08:14:09 jruoho Exp $
+#   $NetBSD: Makefile,v 1.313 2010/01/26 14:00:38 jruoho Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -48,8 +48,8 @@
 	secmodel_suser.9 setjmp.9 shutdownhook_establish.9 \
 	signal.9 sockopt.9 softintr.9 spl.9 splraiseipl.9 \
 	store.9 suspendsched.9 \
-	sysctl.9 sysmon_envsys.9 sysmon_taskq.9 tc.9 tcp_congctl.9 \
-	timecounter.9 time_second.9 todr.9 tvtohz.9 \
+	sysctl.9 sysmon_envsys.9 sysmon_pswitch.9 sysmon_taskq.9 tc.9 \
+	tcp_congctl.9 timecounter.9 time_second.9 todr.9 tvtohz.9 \
 	uiomove.9 ucom.9 userret.9 \
 	vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
 	video.9 vme.9 \
@@ -659,6 +659,9 @@
 	sysmon_envsys.9 sysmon_envsys_unregister.9 \
 	sysmon_envsys.9 sysmon_envsys_sensor_attach.9 \
 	sysmon_envsys.9 sysmon_envsys_sensor_detach.9
+MLINKS+=sysmon_pswitch.9 sysmon_pswitch_event.9 \
+	sysmon_pswitch.9 sysmon_pswitch_register.9 \
+	sysmon_pswitch.9 sysmon_pswitch_unregister.9
 MLINKS+=sysmon_taskq.9 sysmon_task_queue_fini.9 \
 	sysmon_taskq.9 sysmon_task_queue_init.9 \
 	sysmon_taskq.9 sysmon_task_queue_preinit.9 \

Added files:

Index: src/share/man/man9/sysmon_pswitch.9
diff -u /dev/null src/share/man/man9/sysmon_pswitch.9:1.1
--- /dev/null	Tue Jan 26 14:00:38 2010
+++ src/share/man/man9/sysmon_pswitch.9	Tue Jan 26 14:00:38 2010
@@ -0,0 +1,136 @@
+.\ $NetBSD: sysmon_pswitch.9,v 1.1 2010/01/26 14:00:38 jruoho Exp $
+.\
+.\ Copyright (c) 2010 The NetBSD Foundation, Inc.
+.\ All rights reserved.
+.\
+.\ This code is derived from software contributed to The NetBSD Foundation
+.\ by Jukka Ruohonen.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\ POSSIBILITY OF SUCH DAMAGE.
+.\
+.Dd January 26, 2010
+.Dt SYSMON_PSWITCH 9
+.Os
+.Sh NAME
+.Nm sysmon_pswitch
+.Nd framework for power switches
+.Sh SYNOPSIS
+.In dev/sysmon/sysmonvar.h
+.Ft int
+.Fn sysmon_pswitch_register struct sysmon_pswitch *smpsw
+.Ft void
+.Fn sysmon_pswitch_unregister struct sysmon_pswitch *smpsw
+.Ft void
+.Fn sysmon_pswitch_event struct sysmon_pswitch *smpsw int event
+.Sh DESCRIPTION
+The machine-independent
+.Nm
+provides a framework for power management.
+The interface has been largely superceded by the
+.Xr pmf 9
+framework, but
+.Nm
+is still used to manage power switches as well as
+related mechanical adapters and buttons.
+These are encapsulated in the following structure:
+.Bd -literal
+struct sysmon_pswitch {
+	const char *smpsw_name;		/* power switch name */
+	int smpsw_type;			/* power switch type */
+
+	LIST_ENTRY(sysmon_pswitch) smpsw_list;
+};
+.Ed
+.Pp
+Unsurprisingly,
+.Fa smpsw_name
+specifies the name of the power switch and
+.Fa smpsw_type
+defines the type of it.
+The following types are defined:
+.Bl -tag -width PSWITCH_HK_VENDOR_BUTTON -compat -offset indent
+.It PSWITCH_TYPE_POWER
+.It PSWITCH_TYPE_SLEEP
+.It PSWITCH_TYPE_LID
+.It PSWITCH_TYPE_RESET
+.It 

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

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 14:06:36 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Add sysmon_pswitch(9).


To generate a diff of this commit:
cvs rdiff -u -r1.1377 -r1.1378 src/distrib/sets/lists/comp/mi

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1377 src/distrib/sets/lists/comp/mi:1.1378
--- src/distrib/sets/lists/comp/mi:1.1377	Tue Jan 26 08:30:20 2010
+++ src/distrib/sets/lists/comp/mi	Tue Jan 26 14:06:35 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1377 2010/01/26 08:30:20 jruoho Exp $
+#	$NetBSD: mi,v 1.1378 2010/01/26 14:06:35 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -9376,6 +9376,10 @@
 ./usr/share/man/cat9/sysmon_envsys_sensor_attach.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_envsys_sensor_detach.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_envsys_unregister.0	comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_pswitch.0		comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_pswitch_event.0	comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_pswitch_register.0	comp-sys-catman		.cat
+./usr/share/man/cat9/sysmon_pswitch_unregister.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_taskq.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_task_queue_fini.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/sysmon_task_queue_init.0	comp-sys-catman		.cat
@@ -14904,6 +14908,10 @@
 ./usr/share/man/html9/sysmon_envsys_sensor_attach.html	comp-sys-htmlan		html
 ./usr/share/man/html9/sysmon_envsys_sensor_detach.html	comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_envsys_unregister.html	comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_pswitch.html		comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_pswitch_event.html		comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_pswitch_register.html	comp-sys-htmlman	html
+./usr/share/man/html9/sysmon_pswitch_unregister.html	comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_taskq.html		comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_task_queue_fini.html	comp-sys-htmlman	html
 ./usr/share/man/html9/sysmon_task_queue_init.html	comp-sys-htmlman	html
@@ -20639,6 +20647,10 @@
 ./usr/share/man/man9/sysmon_envsys_sensor_attach.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_envsys_sensor_detach.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_envsys_unregister.9	comp-sys-man		.man
+./usr/share/man/man9/sysmon_pswitch.9		comp-sys-man		.man
+./usr/share/man/man9/sysmon_pswitch_event.9	comp-sys-man		.man
+./usr/share/man/man9/sysmon_pswitch_register.9	comp-sys-man		.man
+./usr/share/man/man9/sysmon_pswitch_unregister.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_taskq.9		comp-sys-man		.man
 ./usr/share/man/man9/sysmon_task_queue_fini.9	comp-sys-man		.man
 ./usr/share/man/man9/sysmon_task_queue_init.9	comp-sys-man		.man



CVS commit: src/sys

2010-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 26 14:22:00 UTC 2010

Modified Files:
src/sys/dev/sysmon: sysmon_envsys_events.c
src/sys/sys: envsys.h

Log Message:
Move the limits out of the event structure and into the main sensor.

Use the limits_flags only for calls to the {get,set}_limits() callbacks
and merge the results into upropset, rather than trying to maintain both
values (error prone).


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/sysmon/sysmon_envsys_events.c
cvs rdiff -u -r1.26 -r1.27 src/sys/sys/envsys.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/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.75 src/sys/dev/sysmon/sysmon_envsys_events.c:1.76
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.75	Mon Jan 18 21:48:15 2010
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Tue Jan 26 14:22:00 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.75 2010/01/18 21:48:15 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.76 2010/01/26 14:22:00 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.75 2010/01/18 21:48:15 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.76 2010/01/26 14:22:00 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -90,7 +90,9 @@
 	int error = 0;
 	const char *objkey;
 
-	KASSERT(sdict != NULL || edata != NULL || sme != NULL);
+	KASSERT(sdict != NULL);
+	KASSERT(edata != NULL);
+	KASSERT(sme != NULL);
 
 	/* 
 	 * check if the event is already on the list and return
@@ -103,12 +105,18 @@
 		if (crittype != osee-see_type)
 			continue;
 
+		/*
+		 * We found an existing event for this sensor.  Make 
+		 * sure it references the correct edata
+		 */
+		KASSERT(edata == osee-see_edata);
+
 		DPRINTF((%s: dev %s sensor %s lim_flags 0x%04x event exists\n,
 		__func__, sme-sme_name, edata-desc, lims-sel_flags));
 
 		see = osee;
 		if (lims-sel_flags  PROP_CRITMAX) {
-			if (lims-sel_critmax == see-see_lims.sel_critmax) {
+			if (lims-sel_critmax == edata-limits.sel_critmax) {
 DPRINTF((%s: type=%d (critmax exists)\n,
 __func__, crittype));
 error = EEXIST;
@@ -116,7 +124,7 @@
 			}
 		}
 		if (lims-sel_flags  PROP_WARNMAX) {
-			if (lims-sel_warnmax == see-see_lims.sel_warnmax) {
+			if (lims-sel_warnmax == edata-limits.sel_warnmax) {
 DPRINTF((%s: type=%d (warnmax exists)\n,
 __func__, crittype));
 error = EEXIST;
@@ -124,19 +132,21 @@
 			}
 		}
 		if (lims-sel_flags  (PROP_WARNMIN | PROP_BATTWARN)) {
-			if (lims-sel_warnmin == see-see_lims.sel_warnmin) {
+			if (lims-sel_warnmin == edata-limits.sel_warnmin) {
 DPRINTF((%s: type=%d (warnmin exists)\n,
 __func__, crittype));
 error = EEXIST;
-lims-sel_flags = ~(PROP_WARNMIN | PROP_BATTWARN);
+lims-sel_flags =
+	~(PROP_WARNMIN | PROP_BATTWARN);
 			}
 		}
 		if (lims-sel_flags  (PROP_CRITMIN | PROP_BATTCAP)) {
-			if (lims-sel_critmin == see-see_lims.sel_critmin) {
+			if (lims-sel_critmin == edata-limits.sel_critmin) {
 DPRINTF((%s: type=%d (critmin exists)\n,
 __func__, crittype));
 error = EEXIST;
-lims-sel_flags = ~(PROP_CRITMIN | PROP_BATTCAP);
+lims-sel_flags =
+	~(PROP_CRITMIN | PROP_BATTCAP);
 			}
 		}
 		break;
@@ -199,7 +209,7 @@
 			__func__, sme-sme_name, objkey));
 			error = ENOTSUP;
 		} else {
-			see-see_lims.sel_critmax = lims-sel_critmax;
+			edata-limits.sel_critmax = lims-sel_critmax;
 			error = sme_sensor_upint32(sdict, objkey,
 		   lims-sel_critmax);
 			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
@@ -208,8 +218,7 @@
 		}
 		if (error  error != EEXIST)
 			goto out;
-		see-see_edata-upropset |= PROP_CRITMAX;
-		see-see_lims.sel_flags |= PROP_CRITMAX;
+		edata-upropset |= PROP_CRITMAX;
 	}
 
 	if (lims-sel_flags  PROP_WARNMAX) {
@@ -220,7 +229,7 @@
 			__func__, sme-sme_name, objkey));
 			error = ENOTSUP;
 		} else {
-			see-see_lims.sel_warnmax = lims-sel_warnmax;
+			edata-limits.sel_warnmax = lims-sel_warnmax;
 			error = sme_sensor_upint32(sdict, objkey,
 		   lims-sel_warnmax);
 			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
@@ -229,8 +238,7 @@
 		}
 		if (error  error != EEXIST)
 			goto out;
-		see-see_edata-upropset |= PROP_WARNMAX;
-		see-see_lims.sel_flags |= PROP_WARNMAX;
+		edata-upropset |= PROP_WARNMAX;
 	}
 
 	if (lims-sel_flags  PROP_WARNMIN) {
@@ -241,7 +249,7 @@
 			__func__, sme-sme_name, objkey));
 			error = ENOTSUP;
 		} else {
-			see-see_lims.sel_warnmin = lims-sel_warnmin;
+			edata-limits.sel_warnmin = lims-sel_warnmin;
 			error = sme_sensor_upint32(sdict, objkey,
 		   lims-sel_warnmin);
 			DPRINTF((%s: (%s) event [sensor=%s type=%d] 
@@ -250,8 +258,7 @@
 		}
 		if (error  error != 

CVS commit: src/usr.sbin/powerd

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 14:28:23 UTC 2010

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

Log Message:
Emphasize the script names and events.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/powerd/powerd.8

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

Modified files:

Index: src/usr.sbin/powerd/powerd.8
diff -u src/usr.sbin/powerd/powerd.8:1.19 src/usr.sbin/powerd/powerd.8:1.20
--- src/usr.sbin/powerd/powerd.8:1.19	Mon May  4 19:11:49 2009
+++ src/usr.sbin/powerd/powerd.8	Tue Jan 26 14:28:23 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: powerd.8,v 1.19 2009/05/04 19:11:49 wiz Exp $
+.\	$NetBSD: powerd.8,v 1.20 2010/01/26 14:28:23 jruoho Exp $
 .\
 .\ Copyright (c) 2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -98,27 +98,27 @@
 the device is associated, and the event type.
 .Pp
 The following power switch script names are defined:
-.Bl -tag -width power_button
-.It power_button
+.Bl -tag -width hotkey_button
+.It Em power_button
 This script is called when an event occurs on a power button device.
-.It reset_button
+.It Em reset_button
 This script is called when an event occurs on a reset button device.
-.It sleep_button
+.It Em sleep_button
 This script is called when an event occurs on a sleep button device.
-.It lid_switch
+.It Em lid_switch
 This script is called when an event occurs on a lid switch device.
-.It acadapter
+.It Em acadapter
 This script is called when an online or offline event occurs on an
 AC adapter device.
-.It hotkey_button
+.It Em hotkey_button
 This script is called when an event occurs on a hotkey button device.
 .El
 .Pp
 The following events are defined for power switch devices:
-.Bl -tag -width released
-.It pressed
+.Bl -tag -width hotkey_button
+.It Em pressed
 The button was pressed, the lid closed, or the AC adapter connected.
-.It released
+.It Em released
 The button was released, the lid opened, or the AC adapter disconnected.
 Note that power and sleep button devices usually do not
 post this type of event.
@@ -142,22 +142,22 @@
 .Pp
 The following envsys script names are defined:
 .Bl -tag -width sensor_temperature
-.It sensor_battery
+.It Em sensor_battery
 This script is called when an event occurs on a battery sensor
 (Wh/Ah/Battery state).
-.It sensor_drive
+.It Em sensor_drive
 This script is called when an event occurs on a drive sensor.
-.It sensor_fan
+.It Em sensor_fan
 This script is called when an event occurs on a fan sensor.
-.It sensor_indicator
+.It Em sensor_indicator
 This script is called when an event ocurrs on a indicator/integer sensor.
-.It sensor_power
+.It Em sensor_power
 This script is called when an event occurs on a power sensor (W/Ampere).
-.It sensor_resistance
+.It Em sensor_resistance
 This script is called when an event occurs on a resistance sensor (Ohm).
-.It sensor_temperature
+.It Em sensor_temperature
 This script is called when an event occurs on a temperature sensor.
-.It sensor_voltage
+.It Em sensor_voltage
 This script is called when an event occurs on a voltage sensor.
 .El
 .Pp
@@ -171,23 +171,23 @@
 The following events are defined for fan, indicator, power,
 resistance, temperature and voltage sensors:
 .Bl -tag -width sensor_temperature
-.It critical
+.It Em critical
 A critical condition was triggered.
-.It critical-under
+.It Em critical-under
 A critical under condition was triggered.
-.It critical-over
+.It Em critical-over
 A critical over condition was triggered.
-.It warning-under
+.It Em warning-under
 A warning under condition was triggered.
-.It warning-over
+.It Em warning-over
 A warning over condition was triggered.
 .El
 .Pp
 The following events are defined only for battery sensors:
 .Bl -tag -width sensor_temperature
-.It user-capacity
+.It Em user-capacity
 Capacity dropped below the limit set by the user.
-.It low-power
+.It Em low-power
 System is running in low power, that means that there is not
 any AC Adapter connected and all batteries are in critical or
 low capacity.
@@ -198,7 +198,7 @@
 .Pp
 The following events are defined for drive and battery sensors:
 .Bl -tag -width sensor_temperature
-.It state-changed
+.It Em state-changed
 The state on the sensor has been changed and it's not in normal state.
 .El
 .Pp



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

2010-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jan 26 15:08:52 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: md.amd64

Log Message:
libmagic compat lib is installed again, remove obsolete marker.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/distrib/sets/lists/comp/md.amd64

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/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.62 src/distrib/sets/lists/comp/md.amd64:1.63
--- src/distrib/sets/lists/comp/md.amd64:1.62	Tue Jan 26 12:45:46 2010
+++ src/distrib/sets/lists/comp/md.amd64	Tue Jan 26 15:08:52 2010
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.62 2010/01/26 12:45:46 njoly Exp $
+# $NetBSD: md.amd64,v 1.63 2010/01/26 15:08:52 wiz Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -520,7 +520,7 @@
 ./usr/lib/i386/libm_p.acomp-c-proflib		compat,profile
 ./usr/lib/i386/libm_pic.a			comp-c-piclib		compat,pic
 ./usr/lib/i386/libmagic.a			comp-c-lib		compat
-./usr/lib/i386/libmagic.so			comp-obsolete		obsolete
+./usr/lib/i386/libmagic.so			comp-sys-shlib		compat,pic
 ./usr/lib/i386/libmagic_p.a			comp-c-proflib		compat,profile
 ./usr/lib/i386/libmagic_pic.a			comp-c-piclib		compat,pic
 ./usr/lib/i386/libmenu.a			comp-c-lib		compat



CVS commit: src

2010-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Jan 26 15:11:56 UTC 2010

Modified Files:
src/distrib/sets/lists/text: mi
src/etc/mtree: NetBSD.dist.base
src/gnu/usr.bin/groff/contrib: Makefile
Added Files:
src/gnu/usr.bin/groff/contrib/mom: Makefile Makefile.inc
src/gnu/usr.bin/groff/contrib/mom/examples: Makefile
src/gnu/usr.bin/groff/contrib/mom/momdoc: Makefile

Log Message:
Install mom macro sets again, per request from Petar Bogdanovic.
Don't install generated PostScript files that were part of the reason
for the removal.

Based on a patch by him with slight changes.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/distrib/sets/lists/text/mi
cvs rdiff -u -r1.9 -r1.10 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.4 -r1.5 src/gnu/usr.bin/groff/contrib/Makefile
cvs rdiff -u -r0 -r1.4 src/gnu/usr.bin/groff/contrib/mom/Makefile \
src/gnu/usr.bin/groff/contrib/mom/Makefile.inc
cvs rdiff -u -r0 -r1.8 src/gnu/usr.bin/groff/contrib/mom/examples/Makefile
cvs rdiff -u -r0 -r1.3 src/gnu/usr.bin/groff/contrib/mom/momdoc/Makefile

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/text/mi
diff -u src/distrib/sets/lists/text/mi:1.34 src/distrib/sets/lists/text/mi:1.35
--- src/distrib/sets/lists/text/mi:1.34	Mon Dec 14 02:01:54 2009
+++ src/distrib/sets/lists/text/mi	Tue Jan 26 15:11:56 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.34 2009/12/14 02:01:54 matt Exp $
+# $NetBSD: mi,v 1.35 2010/01/26 15:11:56 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -40,39 +40,39 @@
 ./usr/bin/troff	text-groff-bin		groff
 ./usr/bin/vgrindtext-groff-bin
 ./usr/libexec/vfontedprtext-groff-bin
-./usr/share/doc/grofftext-obsolete		obsolete
-./usr/share/doc/groff/mom			text-obsolete		obsolete
-./usr/share/doc/groff/mom/README.txt		text-obsolete		obsolete
-./usr/share/doc/groff/mom/elvis_syntax		text-obsolete		obsolete
-./usr/share/doc/groff/mom/elvis_syntax.new	text-obsolete		obsolete
-./usr/share/doc/groff/mom/letter.mom		text-obsolete		obsolete
+./usr/share/doc/grofftext-groff-doc		share,groff
+./usr/share/doc/groff/mom			text-groff-doc		share,groff
+./usr/share/doc/groff/mom/README.txt		text-groff-doc		share,groff
+./usr/share/doc/groff/mom/elvis_syntax		text-groff-doc		share,groff
+./usr/share/doc/groff/mom/elvis_syntax.new	text-groff-doc		share,groff
+./usr/share/doc/groff/mom/letter.mom		text-groff-doc		share,groff
 ./usr/share/doc/groff/mom/letter.ps		text-obsolete		obsolete
-./usr/share/doc/groff/mom/penguin.ps		text-obsolete		obsolete
-./usr/share/doc/groff/mom/sample_docs.mom	text-obsolete		obsolete
+./usr/share/doc/groff/mom/penguin.ps		text-groff-doc		share,groff
+./usr/share/doc/groff/mom/sample_docs.mom	text-groff-doc		share,groff
 ./usr/share/doc/groff/mom/sample_docs.ps	text-obsolete		obsolete
-./usr/share/doc/groff/mom/typesetting.mom	text-obsolete		obsolete
+./usr/share/doc/groff/mom/typesetting.mom	text-groff-doc		share,groff
 ./usr/share/doc/groff/mom/typesetting.ps	text-obsolete		obsolete
-./usr/share/doc/html/groff			text-obsolete		obsolete
-./usr/share/doc/html/groff/mom			text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/appendices.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/color.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/cover.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/definitions.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/docelement.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/docprocessing.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/goodies.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/headfootpage.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/inlines.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/intro.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/letters.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/macrolist.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/rectoverso.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/refer.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/reserved.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/toc.html		text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/typemacdoc.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/typesetting.html	text-obsolete		obsolete
-./usr/share/doc/html/groff/mom/using.html	text-obsolete		obsolete
+./usr/share/doc/html/groff			text-groff-doc		share,groff
+./usr/share/doc/html/groff/mom			text-groff-doc		share,groff
+./usr/share/doc/html/groff/mom/appendices.html	text-groff-doc		share,groff
+./usr/share/doc/html/groff/mom/color.html	text-groff-doc		share,groff
+./usr/share/doc/html/groff/mom/cover.html	text-groff-doc		share,groff

CVS commit: src/doc

2010-01-26 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jan 26 16:59:27 UTC 2010

Modified Files:
src/doc: 3RDPARTY

Log Message:
note current isc-dhcp versions
(our branch is not listed as supported anymore)


To generate a diff of this commit:
cvs rdiff -u -r1.745 -r1.746 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.745 src/doc/3RDPARTY:1.746
--- src/doc/3RDPARTY:1.745	Fri Jan 22 20:33:18 2010
+++ src/doc/3RDPARTY	Tue Jan 26 16:59:27 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.745 2010/01/22 20:33:18 snj Exp $
+#	$NetBSD: 3RDPARTY,v 1.746 2010/01/26 16:59:27 drochner Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -253,7 +253,7 @@
 
 Package:	dhcp
 Version:	3.0.3
-Current Vers:	3.0.7/3.1.2/4.1.1b1
+Current Vers:	3.1.3/4.0.2/4.1.1
 Maintainer:	mellon
 Archive Site:	ftp://ftp.isc.org/isc/dhcp/
 Home Page:	http://www.isc.org/software/dhcp/



CVS commit: src/sys/rump/net/lib/libsockin

2010-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jan 26 17:41:20 UTC 2010

Modified Files:
src/sys/rump/net/lib/libsockin: sockin.c

Log Message:
support bpf


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/rump/net/lib/libsockin/sockin.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/net/lib/libsockin/sockin.c
diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.20 src/sys/rump/net/lib/libsockin/sockin.c:1.21
--- src/sys/rump/net/lib/libsockin/sockin.c:1.20	Tue Oct 20 12:17:44 2009
+++ src/sys/rump/net/lib/libsockin/sockin.c	Tue Jan 26 17:41:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockin.c,v 1.20 2009/10/20 12:17:44 tron Exp $	*/
+/*	$NetBSD: sockin.c,v 1.21 2010/01/26 17:41:20 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008, 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sockin.c,v 1.20 2009/10/20 12:17:44 tron Exp $);
+__KERNEL_RCSID(0, $NetBSD: sockin.c,v 1.21 2010/01/26 17:41:20 pooka Exp $);
 
 #include sys/param.h
 #include sys/condvar.h
@@ -42,6 +42,8 @@
 #include sys/socketvar.h
 #include sys/time.h
 
+#include net/bpf.h
+#include net/if.h
 #include net/radix.h
 
 #include netinet/in.h
@@ -116,6 +118,10 @@
 static bool rebuild;
 static int nsock;
 
+/* XXX: for the bpf hack */
+static struct ifnet sockin_if;
+int ifpromisc(struct ifnet *ifp, int pswitch) { return 0; }
+
 static int
 registersock(struct socket *so, int news)
 {
@@ -207,6 +213,9 @@
 	}
 	m-m_len = m-m_pkthdr.len = n;
 
+	if (sockin_if.if_bpf)
+		bpf_ops-bpf_mtap_af(sockin_if.if_bpf, AF_UNSPEC, m);
+
 	mutex_enter(softnet_lock);
 	if (so-so_proto-pr_type == SOCK_DGRAM) {
 		if (!sbappendaddr(so-so_rcv, rmsg.msg_name, m, NULL)) {
@@ -340,6 +349,8 @@
 		printf(sockin_init: no threads = no worker thread\n);
 	}
 	mutex_init(su_mtx, MUTEX_DEFAULT, IPL_NONE);
+	strlcpy(sockin_if.if_xname, sockin0, sizeof(sockin_if.if_xname));
+	bpf_ops-bpf_attach(sockin_if, DLT_NULL, 0, sockin_if.if_bpf);
 }
 
 static int
@@ -413,6 +424,9 @@
 		size_t tot;
 		int s;
 
+		if (sockin_if.if_bpf)
+			bpf_ops-bpf_mtap_af(sockin_if.if_bpf, AF_UNSPEC, m);
+
 		memset(mhdr, 0, sizeof(mhdr));
 
 		iov_max = 0;



CVS commit: src/sys/rump/dev/lib/libbpf

2010-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jan 26 17:50:02 UTC 2010

Modified Files:
src/sys/rump/dev/lib/libbpf: component.c

Log Message:
let attach via module space


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libbpf/component.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/dev/lib/libbpf/component.c
diff -u src/sys/rump/dev/lib/libbpf/component.c:1.1 src/sys/rump/dev/lib/libbpf/component.c:1.2
--- src/sys/rump/dev/lib/libbpf/component.c:1.1	Tue Jan 19 22:38:21 2010
+++ src/sys/rump/dev/lib/libbpf/component.c	Tue Jan 26 17:50:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: component.c,v 1.1 2010/01/19 22:38:21 pooka Exp $	*/
+/*	$NetBSD: component.c,v 1.2 2010/01/26 17:50:02 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: component.c,v 1.1 2010/01/19 22:38:21 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: component.c,v 1.2 2010/01/26 17:50:02 pooka Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -39,8 +39,6 @@
 #include rump_dev_private.h
 #include rump_vfs_private.h
 
-void bpfilterattach(int);
-
 void
 rump_dev_bpf_init()
 {
@@ -53,6 +51,4 @@
 		panic(bpf devsw attach failed: %d, error);
 	if ((error = rump_vfs_makeonedevnode(S_IFCHR, /dev/bpf, cmaj, 0)) !=0)
 		panic(cannot create bpf device nodes: %d, error);
-
-	rump_pdev_add(bpfilterattach, 1);
 }



CVS commit: src/sys/rump/net/rumptest

2010-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jan 26 17:52:21 UTC 2010

Modified Files:
src/sys/rump/net/rumptest: Makefile rumptest_net.c

Log Message:
support bpf from sockin too (i.e. DLT_NULL/AF_UNSPEC)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/rump/net/rumptest/Makefile
cvs rdiff -u -r1.16 -r1.17 src/sys/rump/net/rumptest/rumptest_net.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/net/rumptest/Makefile
diff -u src/sys/rump/net/rumptest/Makefile:1.9 src/sys/rump/net/rumptest/Makefile:1.10
--- src/sys/rump/net/rumptest/Makefile:1.9	Mon Jan 25 22:26:19 2010
+++ src/sys/rump/net/rumptest/Makefile	Tue Jan 26 17:52:21 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2010/01/25 22:26:19 pooka Exp $
+#	$NetBSD: Makefile,v 1.10 2010/01/26 17:52:21 pooka Exp $
 #
 
 PROG=	rumptest_net
@@ -9,13 +9,14 @@
 LDADD=	-lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_virtif \
 	-lrumpuser -lpthread
 CPPFLAGS+=	-DFULL_NETWORK_STACK
+
+# use protocol families provided by host kernel sockets
+#LDADD=	-lrump -lrumpnet -lrumpnet_sockin -lrumpuser -lpthread
+
 # for loading bpf module
 LDADD+=	-lrumpvfs
 
-# uncomment for bpf support
+# uncomment for bpf support (there's kmod support too, though)
 #LDADD+= 	-lrumpdev_bpf -lrumpdev -lrumpvfs
 
-# use protocol families provided by host kernel sockets
-#LDADD=	-lrump -lrumpnet -lrumpnet_sockin -lrumpuser -lpthread
-
 .include bsd.prog.mk

Index: src/sys/rump/net/rumptest/rumptest_net.c
diff -u src/sys/rump/net/rumptest/rumptest_net.c:1.16 src/sys/rump/net/rumptest/rumptest_net.c:1.17
--- src/sys/rump/net/rumptest/rumptest_net.c:1.16	Mon Jan 25 22:25:38 2010
+++ src/sys/rump/net/rumptest/rumptest_net.c	Tue Jan 26 17:52:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumptest_net.c,v 1.16 2010/01/25 22:25:38 pooka Exp $	*/
+/*	$NetBSD: rumptest_net.c,v 1.17 2010/01/26 17:52:21 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -55,11 +55,19 @@
 #include stdlib.h
 #include string.h
 #include unistd.h
+#include vis.h
 
 #define DEST_ADDR 204.152.190.12	/* www.NetBSD.org */
 #define DEST_PORT 80			/* take a wild guess */
 
 static in_addr_t youraddr;
+static in_addr_t myaddr;
+
+#ifdef FULL_NETWORK_STACK
+#define IFNAME virt0 /* XXX: hardcoded */
+#else
+#define IFNAME sockin0
+#endif
 
 #ifdef FULL_NETWORK_STACK
 /*
@@ -80,9 +88,6 @@
 #define MYBCAST 10.181.181.255
 #define MYMASK 255.255.255.0
 #define MYGW 10.181.181.1
-#define IFNAME virt0 /* XXX: hardcoded */
-
-static in_addr_t myaddr;
 
 static void
 configure_interface(void)
@@ -181,6 +186,71 @@
 		err(1, routing incomplete);
 	rump_sys_close(s);
 }
+#endif /* FULL_NETWORK_STACK */
+
+static void
+dump_ether(uint8_t *data, size_t caplen)
+{
+	char fmt[64];
+	struct ether_header *ehdr;
+	struct ip *ip;
+	struct tcphdr *tcph;
+
+	ehdr = (void *)data;
+	switch (ntohs(ehdr-ether_type)) {
+	case ETHERTYPE_ARP:
+		printf(ARP\n);
+		break;
+	case ETHERTYPE_IP:
+		printf(IP, );
+		ip = (void *)((uint8_t *)ehdr + sizeof(*ehdr));
+		printf(version %d, proto , ip-ip_v);
+		if (ip-ip_p == IPPROTO_TCP)
+			printf(TCP);
+		else if (ip-ip_p == IPPROTO_UDP)
+			printf(UDP);
+		else
+			printf(unknown);
+		printf(\n);
+
+		/*
+		 * if it's the droids we're looking for,
+		 * print segment contents.
+		 */
+		if (ip-ip_src.s_addr != youraddr ||
+		ip-ip_dst.s_addr != myaddr ||
+		ip-ip_p != IPPROTO_TCP)
+			break;
+		tcph = (void *)((uint8_t *)ip + (ip-ip_hl2));
+		if (ntohs(tcph-th_sport) != 80)
+			break;
+
+		printf(requested data:\n);
+		sprintf(fmt, %%%ds\n,
+		ntohs(ip-ip_len) - (ip-ip_hl2));
+		printf(fmt, (char *)tcph + (tcph-th_off2));
+
+		break;
+	case ETHERTYPE_IPV6:
+		printf(IPv6\n);
+		break;
+	default:
+		printf(unknown type 0x%04x\n,
+		ntohs(ehdr-ether_type));
+		break;
+	}
+}
+
+/* in luck we trust (i.e. true story on how an os works) */
+static void
+dump_nodlt(uint8_t *data, size_t caplen)
+{
+	char buf[32768];
+
+	/* +4 = skip AF */
+	strvisx(buf, (const char *)data+4, caplen-4, 0);
+	printf(%s\n, buf);
+}
 
 static void
 dobpfread(void)
@@ -191,7 +261,8 @@
 	void *buf;
 	struct ifreq ifr;
 	int bpfd, modfd;
-	u_int bpflen, x;
+	u_int bpflen, x, dlt;
+	ssize_t n;
 
 	bpfd = rump_sys_open(/dev/bpf, O_RDWR);
 
@@ -249,13 +320,10 @@
 	if (rump_sys_ioctl(bpfd, BIOCIMMEDIATE, x) == -1)
 		err(1, BIOCIMMEDIATE);
 
-
+	if (rump_sys_ioctl(bpfd, BIOCGDLT, dlt) == -1)
+		err(1, BIOCGDLT);
+	
 	for (;;) {
-		char fmt[64];
-		struct ether_header *ehdr;
-		struct ip *ip;
-		struct tcphdr *tcph;
-		ssize_t n;
 
 		memset(buf, 0, bpflen);
 		n = rump_sys_read(bpfd, buf, bpflen);
@@ -268,57 +336,21 @@
 
 		bhdr = buf;
 		while (bhdr-bh_caplen) {
+			uint8_t *data;
+
 			printf(got packet, caplen %d\n, bhdr-bh_caplen);
-			ehdr = (void *)((uint8_t *)bhdr + bhdr-bh_hdrlen);
-			switch (ntohs(ehdr-ether_type)) {
-			case ETHERTYPE_ARP:
-			

CVS commit: src/share/man/man9

2010-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 26 18:08:24 UTC 2010

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

Log Message:
Fix .Bl markup - s/-compat/-compact/


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/sysmon_pswitch.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/sysmon_pswitch.9
diff -u src/share/man/man9/sysmon_pswitch.9:1.1 src/share/man/man9/sysmon_pswitch.9:1.2
--- src/share/man/man9/sysmon_pswitch.9:1.1	Tue Jan 26 14:00:38 2010
+++ src/share/man/man9/sysmon_pswitch.9	Tue Jan 26 18:08:24 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: sysmon_pswitch.9,v 1.1 2010/01/26 14:00:38 jruoho Exp $
+.\ $NetBSD: sysmon_pswitch.9,v 1.2 2010/01/26 18:08:24 pgoyette Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -67,7 +67,7 @@
 .Fa smpsw_type
 defines the type of it.
 The following types are defined:
-.Bl -tag -width PSWITCH_HK_VENDOR_BUTTON -compat -offset indent
+.Bl -tag -width PSWITCH_HK_VENDOR_BUTTON -compact -offset indent
 .It PSWITCH_TYPE_POWER
 .It PSWITCH_TYPE_SLEEP
 .It PSWITCH_TYPE_LID
@@ -80,7 +80,7 @@
 .Dv PSWITCH_TYPE_HOTKEY ,
 there are few predefined names that can be used for
 .Fa smpsw_name :
-.Bl -tag -width PSWITCH_HK_VENDOR_BUTTON -compat -offset indent
+.Bl -tag -width PSWITCH_HK_VENDOR_BUTTON -compact -offset indent
 .It PSWITCH_HK_DISPLAY_CYCLE
 .Em display-cycle
 .It PSWITCH_HK_LOCK_SCREEN



CVS commit: src/sys/netinet

2010-01-26 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Jan 26 18:09:08 UTC 2010

Modified Files:
src/sys/netinet: tcp_input.c tcp_output.c

Log Message:
tcp sockbuf autoscaling was initially added turned off because it
was experimental.  People (including myself) have been running with
it turned on for eons now, so flip the default to enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.299 -r1.300 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.168 -r1.169 src/sys/netinet/tcp_output.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.299 src/sys/netinet/tcp_input.c:1.300
--- src/sys/netinet/tcp_input.c:1.299	Wed Sep  9 22:41:28 2009
+++ src/sys/netinet/tcp_input.c	Tue Jan 26 18:09:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.299 2009/09/09 22:41:28 darran Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.300 2010/01/26 18:09:07 pooka Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -145,7 +145,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.299 2009/09/09 22:41:28 darran Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.300 2010/01/26 18:09:07 pooka Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -239,7 +239,7 @@
 int	tcprexmtthresh = 3;
 int	tcp_log_refused;
 
-int	tcp_do_autorcvbuf = 0;
+int	tcp_do_autorcvbuf = 1;
 int	tcp_autorcvbuf_inc = 16 * 1024;
 int	tcp_autorcvbuf_max = 256 * 1024;
 int	tcp_msl = (TCPTV_MSL / PR_SLOWHZ);

Index: src/sys/netinet/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.168 src/sys/netinet/tcp_output.c:1.169
--- src/sys/netinet/tcp_output.c:1.168	Wed Mar 18 16:00:22 2009
+++ src/sys/netinet/tcp_output.c	Tue Jan 26 18:09:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_output.c,v 1.168 2009/03/18 16:00:22 cegger Exp $	*/
+/*	$NetBSD: tcp_output.c,v 1.169 2010/01/26 18:09:08 pooka Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.168 2009/03/18 16:00:22 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_output.c,v 1.169 2010/01/26 18:09:08 pooka Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -215,7 +215,7 @@
 int	tcp_cwm = 0;
 int	tcp_cwm_burstsize = 4;
 
-int	tcp_do_autosndbuf = 0;
+int	tcp_do_autosndbuf = 1;
 int	tcp_autosndbuf_inc = 8 * 1024;
 int	tcp_autosndbuf_max = 256 * 1024;
 



CVS commit: src/dist/dhcp/dst

2010-01-26 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Tue Jan 26 19:11:01 UTC 2010

Modified Files:
src/dist/dhcp/dst: dst_api.c dst_internal.h prandom.c

Log Message:
rather than adding braces in the code, define the offending macro
to (void)0. This is what similar code in bind9 (up to 9.5) does.
(native NetBSD code usually does do { } while (/* CONSTCOND */ 0)
in this case)
Anyway, I've checked the code, didn't find ambiguities due to
the empty statements, so the whole thing is harmless.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/dst/dst_api.c
cvs rdiff -u -r1.1 -r1.2 src/dist/dhcp/dst/dst_internal.h
cvs rdiff -u -r1.5 -r1.6 src/dist/dhcp/dst/prandom.c

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

Modified files:

Index: src/dist/dhcp/dst/dst_api.c
diff -u src/dist/dhcp/dst/dst_api.c:1.6 src/dist/dhcp/dst/dst_api.c:1.7
--- src/dist/dhcp/dst/dst_api.c:1.6	Mon Jan 25 20:33:57 2010
+++ src/dist/dhcp/dst/dst_api.c	Tue Jan 26 19:11:00 2010
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/dst_api.c,v 1.6 2010/01/25 20:33:57 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/dst_api.c,v 1.7 2010/01/26 19:11:00 drochner Exp $;
 #endif
 
 /*
@@ -684,10 +684,9 @@
 		if (key_st-dk_func-from_dns_key(key_st, rdata[start],
 		  len - start)  0)
 			return (key_st);
-	} else {
+	} else
 		EREPORT((dst_dnskey_to_public_key(): unsuppored alg %d\n,
 			 alg));
-	}
 
 	SAFE_FREE(key_st);
 	return (key_st);
@@ -746,10 +745,9 @@
 			return (enc_len + loc);
 		else
 			return (-1);
-	} else {
+	} else
 		EREPORT((dst_key_to_dnskey(): Unsupported ALG %d\n,
 			 key-dk_alg));
-	}
 	return (-1);
 }
 
@@ -879,11 +877,10 @@
 		EREPORT((dst_s_read_private_key_file(): Unknown keyfile %d.%d version for %s\n,
 			 file_major, file_minor, name));
 		goto fail;
-	} else if (file_major  major || file_minor  minor) {
+	} else if (file_major  major || file_minor  minor)
 		EREPORT((
 dst_s_read_private_key_file(): Keyfile %s version higher than mine %d.%d MAY FAIL\n,
 name, file_major, file_minor));
-	}
 
 	while (*p++ != '\n') ;	/* skip to end of line */
 

Index: src/dist/dhcp/dst/dst_internal.h
diff -u src/dist/dhcp/dst/dst_internal.h:1.1 src/dist/dhcp/dst/dst_internal.h:1.2
--- src/dist/dhcp/dst/dst_internal.h:1.1	Fri Aug  3 11:35:34 2001
+++ src/dist/dhcp/dst/dst_internal.h	Tue Jan 26 19:11:00 2010
@@ -60,7 +60,7 @@
 #ifdef REPORT_ERRORS
 #define EREPORT(str)		printf str
 #else
-#define EREPORT(str)
+#define EREPORT(str)		(void)0
 #endif
 
 /* use our own special macro to FRRE memory */

Index: src/dist/dhcp/dst/prandom.c
diff -u src/dist/dhcp/dst/prandom.c:1.5 src/dist/dhcp/dst/prandom.c:1.6
--- src/dist/dhcp/dst/prandom.c:1.5	Mon Jan 25 20:33:57 2010
+++ src/dist/dhcp/dst/prandom.c	Tue Jan 26 19:11:00 2010
@@ -1,5 +1,5 @@
 #ifndef LINT
-static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.5 2010/01/25 20:33:57 drochner Exp $;
+static const char rcsid[] = $Header: /cvsroot/src/dist/dhcp/dst/prandom.c,v 1.6 2010/01/26 19:11:00 drochner Exp $;
 #endif
 /*
  * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
@@ -850,9 +850,8 @@
 		i = dst_sign_data(SIG_MODE_ALL, my_key, NULL, 
   (u_char *) counter, hb_size,
   semi_old, sizeof(semi_old));
-		if (i != hb_size) {
+		if (i != hb_size)
 			EREPORT((HMAC SIGNATURE FAILURE %d\n, i));
-		}
 		cnt++;
 		if (size - out  i)	/* Not all data is needed */
 			semi_loc = i = size - out;



CVS commit: src/usr.sbin/powerd

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 20:37:13 UTC 2010

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

Log Message:
Some miscellaneous fixes:

 * Apparently there is only a single location for the scripts. Thus, remove
   the references to /etc/powerd/scripts/apm and /etc/powerd/scripts/acpi.
 * Correct confusion: instead of the device with which the device is
   associated, write the device with which the event is associated.
   Correct also an example related to this.
 * Improve wording, grammar, and markup in few places.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/powerd/powerd.8

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

Modified files:

Index: src/usr.sbin/powerd/powerd.8
diff -u src/usr.sbin/powerd/powerd.8:1.20 src/usr.sbin/powerd/powerd.8:1.21
--- src/usr.sbin/powerd/powerd.8:1.20	Tue Jan 26 14:28:23 2010
+++ src/usr.sbin/powerd/powerd.8	Tue Jan 26 20:37:13 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: powerd.8,v 1.20 2010/01/26 14:28:23 jruoho Exp $
+.\	$NetBSD: powerd.8,v 1.21 2010/01/26 20:37:13 jruoho Exp $
 .\
 .\ Copyright (c) 2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -63,27 +63,13 @@
 will stay in the foreground of the controlling terminal.
 .El
 .Sh CONFIGURATION SCRIPTS
-All of
+All configuration of
 .Nm
-configuration is encapsulated into scripts that are run when power
-management events occur.
-.Nm
-will look for these scripts in two locations.
-The first location is
-.Pa /etc/powerd/scripts/\*[Lt]power_type\*[Gt] ,
-where
-.Aq Pa power_type
-is defined by the power management mechanism supported by the system,
-e.g.,
-.Dq apm
-or
-.Dq acpi .
-If the script is not found in the first location,
-.Nm
-looks in
+is encapsulated into scripts that are run when power management events occur.
+The daemon will look for the scripts from the directory
 .Pa /etc/powerd/scripts .
 .Pp
-Configuration scripts are run synchronously, i.e.,
+Configuration scripts are run synchronously;
 .Nm
 will start the script and wait for its completion before it handles
 the next event.
@@ -95,7 +81,7 @@
 Power switch scripts are called when a state change event occurs on
 a power switch device.
 Power switch scripts are called with two arguments: the device with which
-the device is associated, and the event type.
+the event is associated, and the event type.
 .Pp
 The following power switch script names are defined:
 .Bl -tag -width hotkey_button
@@ -117,9 +103,11 @@
 The following events are defined for power switch devices:
 .Bl -tag -width hotkey_button
 .It Em pressed
-The button was pressed, the lid closed, or the AC adapter connected.
+The button was pressed, the lid was closed,
+or the AC adapter was connected.
 .It Em released
-The button was released, the lid opened, or the AC adapter disconnected.
+The button was released, the lid was opened,
+or the AC adapter was disconnected.
 Note that power and sleep button devices usually do not
 post this type of event.
 .El
@@ -127,13 +115,13 @@
 The following is an example of how a power button script might be invoked
 when a power button is pressed by the operator:
 .Bd -literal -offset indent
-/etc/powerd/scripts/power_button acpi0 pressed
+/etc/powerd/scripts/power_button acpibut0 pressed
 .Ed
 .Ss ENVSYS SCRIPTS
 .Xr envsys 4
 scripts are called when a condition was triggered in a sensor.
 These scripts are called with three arguments: the
-device associated, the event type and sensor's name.
+device associated, the event type, and the sensor's name.
 The
 .Sy sensor_drive
 and the
@@ -161,15 +149,8 @@
 This script is called when an event occurs on a voltage sensor.
 .El
 .Pp
-The following event is defined for all scripts but is only sent if
-a critical/warning or any other event was previously sent:
-.Bl -tag -width sensor_temperature
-.It normal
-A normal state/capacity/condition was triggered.
-.El
-.Pp
 The following events are defined for fan, indicator, power,
-resistance, temperature and voltage sensors:
+resistance, temperature, and voltage sensors:
 .Bl -tag -width sensor_temperature
 .It Em critical
 A critical condition was triggered.
@@ -183,23 +164,28 @@
 A warning over condition was triggered.
 .El
 .Pp
+The following event is defined for all scripts, but it is only sent if
+any of the previous events has been previously sent:
+.Bl -tag -width sensor_temperature
+.It Em normal
+A normal state/capacity/condition was triggered.
+.El
+.Pp
 The following events are defined only for battery sensors:
 .Bl -tag -width sensor_temperature
 .It Em user-capacity
 Capacity dropped below the limit set by the user.
 .It Em low-power
-System is running in low power, that means that there is not
-any AC Adapter connected and all batteries are in critical or
-low capacity.
-When this event is received there's no much time so you should only
-suspend or shutdown the system.
+System is running in low power.
+This 

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

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 26 21:05:26 UTC 2010

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

Log Message:
Add ucas_{32,64}


To generate a diff of this commit:
cvs rdiff -u -r1.9.18.5 -r1.9.18.6 src/sys/arch/mips/mips/lock_stubs.S

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

Modified files:

Index: src/sys/arch/mips/mips/lock_stubs.S
diff -u src/sys/arch/mips/mips/lock_stubs.S:1.9.18.5 src/sys/arch/mips/mips/lock_stubs.S:1.9.18.6
--- src/sys/arch/mips/mips/lock_stubs.S:1.9.18.5	Sun Sep  6 23:00:38 2009
+++ src/sys/arch/mips/mips/lock_stubs.S	Tue Jan 26 21:05:26 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.9.18.5 2009/09/06 23:00:38 matt Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.9.18.6 2010/01/26 21:05:26 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -33,6 +33,8 @@
 #include opt_lockdebug.h
 #include opt_multiprocessor.h
 
+#include sys/errno.h
+
 #include machine/asm.h
 #include machine/cpu.h
 
@@ -121,6 +123,74 @@
 STRONG_ALIAS(_atomic_cas_uint_ni,_atomic_cas_uint)
 STRONG_ALIAS(atomic_cas_uint_ni,_atomic_cas_uint)
 
+/*
+ * int ucas_32(volatile uint32_t *ptr, uint32_t old, uint32_t new, uint32_t *ret)
+ */
+LEAF(ucas_32)
+	.set at
+	PTR_LA	v0, _C_LABEL(ucaserr)
+	.set noat
+	PTR_L	v1, L_ADDR(MIPS_CURLWP)
+	PTR_S	v0, U_PCB_ONFAULT(v1)
+	blt	a0, zero, _C_LABEL(ucaserr)
+	 nop
+	move	v0, zero
+
+1:	INT_LL	t0, 0(a0)
+	 nop
+	bne	t0, a1, 2f
+	 move	t1, a2
+	INT_SC	t1, 0(a0)
+	beqz	t1, 1b
+	 nop
+
+2:	PTR_S	zero, U_PCB_ONFAULT(v1)
+	j	ra
+	 INT_S	t0, 0(a3)
+END(ucas_32)
+
+STRONG_ALIAS(ucas_int, ucas_32)
+STRONG_ALIAS(ucas_uint, ucas_32)
+#ifndef _LP64
+STRONG_ALIAS(ucas_long, ucas_32)
+STRONG_ALIAS(ucas_ulong, ucas_32)
+STRONG_ALIAS(ucas_ptr, ucas_32)
+#endif
+
+#ifndef __mips_o32
+/*
+ * int ucas_64(volatile uint64_t *ptr, uint64_t old, uint64_t new, uint64_t *ret)
+ */
+LEAF(ucas_64)
+	.set at
+	PTR_LA	v0, _C_LABEL(ucaserr)
+	.set noat
+	PTR_L	v1, L_ADDR(MIPS_CURLWP)
+	PTR_S	v0, U_PCB_ONFAULT(v1)
+	blt	a0, zero, _C_LABEL(ucaserr)
+	 nop
+	move	v0, zero
+
+1:	REG_LL	t0, 0(a0)
+	 nop
+	bne	t0, a1, 2f
+	 move	t1, a2
+	REG_SC	t1, 0(a0)
+	beqz	t1, 1b
+	 nop
+
+2:	PTR_S	zero, U_PCB_ONFAULT(v1)
+	j	ra
+	 REG_S	t0, 0(a3)
+END(ucas_64)
+#ifdef _LP64
+STRONG_ALIAS(ucas_ptr, ucas_64)
+STRONG_ALIAS(ucas_long, ucas_64)
+STRONG_ALIAS(ucas_ulong, ucas_64)
+#endif
+
+#endif /* !__mips_o32 */
+
 #ifndef LOCKDEBUG
 
 /*
@@ -243,7 +313,7 @@
  * unsigned long old, unsigned long new);
  */
 	.text
-	.align	7
+	.p2align 7
 
 EXPORT(_lock_ras_start)
 
@@ -280,7 +350,26 @@
 STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_ulong)
 STRONG_ALIAS(atomic_cas_ptr_ni,_atomic_cas_ulong)
 
+	.p2align 5
+	nop
+	nop
+	nop
+LEAF_NOPROFILE(_ucas_32_ras)
+	PTR_L	t0, (a0)	/* - critical section start */
+_ucas_32_ras_start:
+	 nop
+	bne	t0, a1, 1f
+ 	 nop
+	PTR_S	a2, (a0)	/* - critical section end */
+1:
+	PTR_S	zero, U_PCB_ONFAULT(v1)
+	j	ra
+	 INT_S	t0, 0(a3)
+END(_ucas_32_ras)
+
+
 #ifndef LOCKDEBUG
+	.p2align 5
 /*
  * int mutex_enter(kmutex_t *mtx);
  */
@@ -303,6 +392,7 @@
 /*
  * int mutex_exit(kmutex_t *mtx);
  */
+	.p2align 5
 	nop
 	nop
 	nop
@@ -319,7 +409,7 @@
 END(mutex_exit)
 	 nop
 
-	.align	7			/* Get out of the RAS block */
+	.p2align 7			/* Get out of the RAS block */
 
 /*
  * void	mutex_spin_enter(kmutex_t *mtx);
@@ -389,6 +479,9 @@
 	la	t0, _atomic_cas_start
 	beq	t2, t0, 1f
 	 nop
+	addiu	t0, _ucas_32_ras_start - _atomic_cas_start
+	beq	t2, t0, 1f
+	 nop
 #ifndef LOCKDEBUG
 	addiu	t0, _mutex_enter_start - _atomic_cas_start
 	beq	t2, t0, 1f
@@ -404,8 +497,35 @@
 	 addiu	k1, t0, -4
 END(_lock_ras)
 
+/*
+ * int ucas_32(volatile uint32_t *ptr, uint32_t old, uint32_t new, uint32_t *ret)
+ */
+LEAF(ucas_32)
+	PTR_L	v1, L_ADDR(MIPS_CURLWP)
+	PTR_LA	v0, _C_LABEL(ucaserr)
+	PTR_S	v0, U_PCB_ONFAULT(v1)
+	blt	a0, zero, _C_LABEL(ucaserr)
+	 nop
+	b	_C_LABEL(_ucas_32_ras)
+	 move	v0, zero
+END(ucas_32)
+
+STRONG_ALIAS(ucas_int, ucas_32)
+STRONG_ALIAS(ucas_uint, ucas_32)
+STRONG_ALIAS(ucas_long, ucas_32)
+STRONG_ALIAS(ucas_ulong, ucas_32)
+STRONG_ALIAS(ucas_ptr, ucas_32)
 #endif	/* MIPS_HAS_LLSC == 0 */
 
+/*
+ *
+ */
+LEAF(ucaserr)
+	PTR_S	zero, U_PCB_ONFAULT(v1)		# reset fault handler
+	j	ra
+	 li	v0, EFAULT			# return EFAULT on error
+END(ucaserr)
+
 #ifndef LOCKDEBUG
 
 /*



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

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 26 21:07:14 UTC 2010

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

Log Message:
Make sure the kernel pages allocated for vmmapbuf have the same page color.


To generate a diff of this commit:
cvs rdiff -u -r1.121.6.1.2.5 -r1.121.6.1.2.6 \
src/sys/arch/mips/mips/vm_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.5 src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.6
--- src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.5	Tue Sep  8 07:46:14 2009
+++ src/sys/arch/mips/mips/vm_machdep.c	Tue Jan 26 21:07:14 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.121.6.1.2.5 2009/09/08 07:46:14 uebayasi Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.121.6.1.2.6 2010/01/26 21:07:14 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -80,7 +80,7 @@
 #include opt_coredump.h
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.121.6.1.2.5 2009/09/08 07:46:14 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.121.6.1.2.6 2010/01/26 21:07:14 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -291,6 +291,12 @@
 }
 #endif
 
+static struct evcnt evcnt_vmapbuf =
+EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, vmapbuf, calls);
+static struct evcnt evcnt_vmapbuf_adjustments =
+EVCNT_INITIALIZER(EVCNT_TYPE_MISC, evcnt_vmapbuf,
+	vmapbuf, adjustments);
+
 /*
  * Map a user I/O request into kernel virtual address space.
  */
@@ -302,14 +308,21 @@
 	vaddr_t kva;	/* Kernel VA (new to) */
 	paddr_t pa;	/* physical address */
 	vsize_t off;
+	vsize_t coloroff;
 
 	if ((bp-b_flags  B_PHYS) == 0)
 		panic(vmapbuf);
 
+	evcnt_vmapbuf.ev_count++;
 	uva = mips_trunc_page(bp-b_saveaddr = bp-b_data);
+	coloroff = uva  ptoa(uvmexp.colormask);
+	if (coloroff)
+		evcnt_vmapbuf_adjustments.ev_count++;
 	off = (vaddr_t)bp-b_data - uva;
 	len = mips_round_page(off + len);
-	kva = uvm_km_alloc(phys_map, len, 0, UVM_KMF_VAONLY | UVM_KMF_WAITVA);
+	kva = uvm_km_alloc(phys_map, len + coloroff, ptoa(uvmexp.ncolors),
+	UVM_KMF_VAONLY | UVM_KMF_WAITVA);
+	kva += coloroff;
 	bp-b_data = (void *)(kva + off);
 	upmap = vm_map_pmap(bp-b_proc-p_vmspace-vm_map);
 	do {
@@ -332,16 +345,18 @@
 {
 	vaddr_t kva;
 	vsize_t off;
+	vsize_t coloroff;
 
 	if ((bp-b_flags  B_PHYS) == 0)
 		panic(vunmapbuf);
 
 	kva = mips_trunc_page(bp-b_data);
+	coloroff = kva  ptoa(uvmexp.colormask);
 	off = (vaddr_t)bp-b_data - kva;
 	len = mips_round_page(off + len);
 	pmap_remove(vm_map_pmap(phys_map), kva, kva + len);
 	pmap_update(pmap_kernel());
-	uvm_km_free(phys_map, kva, len, UVM_KMF_VAONLY);
+	uvm_km_free(phys_map, kva - coloroff, len + coloroff, UVM_KMF_VAONLY);
 	bp-b_data = bp-b_saveaddr;
 	bp-b_saveaddr = NULL;
 }



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

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 26 21:09:54 UTC 2010

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

Log Message:
If ELFSIZE == 64, define ELF64_MACHDEP_ID_CASES regardless of _LP64


To generate a diff of this commit:
cvs rdiff -u -r1.10.96.7 -r1.10.96.8 src/sys/arch/mips/include/elf_machdep.h

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

Modified files:

Index: src/sys/arch/mips/include/elf_machdep.h
diff -u src/sys/arch/mips/include/elf_machdep.h:1.10.96.7 src/sys/arch/mips/include/elf_machdep.h:1.10.96.8
--- src/sys/arch/mips/include/elf_machdep.h:1.10.96.7	Sat Sep 12 17:26:23 2009
+++ src/sys/arch/mips/include/elf_machdep.h	Tue Jan 26 21:09:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.10.96.7 2009/09/12 17:26:23 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.10.96.8 2010/01/26 21:09:54 matt Exp $	*/
 
 #ifndef _MIPS_ELF_MACHDEP_H_
 #define  _MIPS_ELF_MACHDEP_H_
@@ -12,13 +12,9 @@
 #define	ELF32_MACHDEP_ID	EM_MIPS
 #endif /* ELFSIZE == 32 */
 #if ELFSIZE == 64
-#ifdef _LP64
 #define	ELF64_MACHDEP_ID_CASES		\
 		case EM_MIPS:		\
 			break;
-#else
-#define	ELF64_MACHDEP_ID_CASES		/* xxx */
-#endif /* _LP64 */
 
 #define	ELF64_MACHDEP_ID	EM_MIPS
 #endif /* ELFSIZE == 64 */



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

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jan 26 21:26:28 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_extern.h uvm_fault.c uvm_km.c
uvm_page.c

Log Message:
Pass hints to uvm_pagealloc* to get it to use the right page color rather
than guess the right page color.


To generate a diff of this commit:
cvs rdiff -u -r1.148.4.2 -r1.148.4.2.4.1 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.125.6.1 -r1.125.6.1.4.1 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.101.4.2.4.1 -r1.101.4.2.4.2 src/sys/uvm/uvm_km.c
cvs rdiff -u -r1.140.6.3.4.1 -r1.140.6.3.4.2 src/sys/uvm/uvm_page.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/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.148.4.2 src/sys/uvm/uvm_extern.h:1.148.4.2.4.1
--- src/sys/uvm/uvm_extern.h:1.148.4.2	Wed Apr  1 00:25:23 2009
+++ src/sys/uvm/uvm_extern.h	Tue Jan 26 21:26:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.148.4.2 2009/04/01 00:25:23 snj Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.148.4.2.4.1 2010/01/26 21:26:28 matt Exp $	*/
 
 /*
  *
@@ -146,6 +146,7 @@
 #define UVM_FLAG_QUANTUM 0x80 /* entry can never be split later */
 #define UVM_FLAG_WAITVA  0x100 /* wait for va */
 #define UVM_FLAG_VAONLY  0x200 /* unmap: no pages are mapped */
+#define UVM_FLAG_COLORMATCH 0x400 /* match color given in off */
 
 /* macros to extract info */
 #define UVM_PROTECTION(X)	((X)  UVM_PROT_MASK)

Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.125.6.1 src/sys/uvm/uvm_fault.c:1.125.6.1.4.1
--- src/sys/uvm/uvm_fault.c:1.125.6.1	Mon Feb  2 18:31:37 2009
+++ src/sys/uvm/uvm_fault.c	Tue Jan 26 21:26:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_fault.c,v 1.125.6.1 2009/02/02 18:31:37 snj Exp $	*/
+/*	$NetBSD: uvm_fault.c,v 1.125.6.1.4.1 2010/01/26 21:26:28 matt Exp $	*/
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.125.6.1 2009/02/02 18:31:37 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_fault.c,v 1.125.6.1.4.1 2010/01/26 21:26:28 matt Exp $);
 
 #include opt_uvmhist.h
 
@@ -362,7 +362,8 @@
 			 * no page, we must try and bring it in.
 			 */
 
-			pg = uvm_pagealloc(NULL, 0, anon, 0);
+			pg = uvm_pagealloc(NULL, ufi-orig_rvaddr,
+			NULL, UVM_FLAG_COLORMATCH);
 			if (pg == NULL) {		/* out of RAM.  */
 uvmfault_unlockall(ufi, amap, NULL, anon);
 uvmexp.fltnoram++;
@@ -620,8 +621,8 @@
 		 * so have uvm_pagealloc() do that for us.
 		 */
 
-		pg = uvm_pagealloc(NULL, 0, anon,
-		(opg == NULL) ? UVM_PGA_ZERO : 0);
+		pg = uvm_pagealloc(NULL, ufi-orig_rvaddr, anon,
+		UVM_FLAG_COLORMATCH | (opg == NULL ? UVM_PGA_ZERO : 0));
 	} else {
 		pg = NULL;
 	}
@@ -1266,7 +1267,8 @@
 			if (anon-an_ref == 1) {
 
 /* get new un-owned replacement page */
-pg = uvm_pagealloc(NULL, 0, NULL, 0);
+pg = uvm_pagealloc(NULL, ufi.orig_rvaddr,
+NULL, UVM_FLAG_COLORMATCH);
 if (pg == NULL) {
 	uvmfault_unlockall(ufi, amap, uobj,
 	anon);

Index: src/sys/uvm/uvm_km.c
diff -u src/sys/uvm/uvm_km.c:1.101.4.2.4.1 src/sys/uvm/uvm_km.c:1.101.4.2.4.2
--- src/sys/uvm/uvm_km.c:1.101.4.2.4.1	Sat Jan  9 05:54:40 2010
+++ src/sys/uvm/uvm_km.c	Tue Jan 26 21:26:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_km.c,v 1.101.4.2.4.1 2010/01/09 05:54:40 matt Exp $	*/
+/*	$NetBSD: uvm_km.c,v 1.101.4.2.4.2 2010/01/26 21:26:28 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -128,7 +128,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_km.c,v 1.101.4.2.4.1 2010/01/09 05:54:40 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_km.c,v 1.101.4.2.4.2 2010/01/26 21:26:28 matt Exp $);
 
 #include opt_uvmhist.h
 
@@ -589,7 +589,7 @@
 	loopva = kva;
 	loopsize = size;
 
-	pgaflags = 0;
+	pgaflags = UVM_FLAG_COLORMATCH;
 	if (flags  UVM_KMF_NOWAIT)
 		pgaflags |= UVM_PGA_USERESERVE;
 	if (flags  UVM_KMF_ZERO)

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.140.6.3.4.1 src/sys/uvm/uvm_page.c:1.140.6.3.4.2
--- src/sys/uvm/uvm_page.c:1.140.6.3.4.1	Sat Sep 12 18:38:46 2009
+++ src/sys/uvm/uvm_page.c	Tue Jan 26 21:26:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.1 2009/09/12 18:38:46 matt Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.2 2010/01/26 21:26:28 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3.4.1 2009/09/12 18:38:46 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3.4.2 2010/01/26 21:26:28 matt Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -1074,7 +1074,7 @@
 	lwp_t *l;
 
 	KASSERT(obj == NULL || anon == NULL);
-	KASSERT(anon == NULL || off == 0);
+	KASSERT(anon == NULL || (flags  UVM_FLAG_COLORMATCH) || off == 0);
 	KASSERT(off == trunc_page(off));
 	KASSERT(obj == NULL || 

CVS commit: src

2010-01-26 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Tue Jan 26 21:27:55 UTC 2010

Modified Files:
src/lib/libc/net: getnameinfo.c
src/sbin/route: show.c

Log Message:
Add AF_APPLETALK support to getnameinfo(); make route show use it.
Doesn't print ranges yet (should it be done here?); only numeric
output.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/net/getnameinfo.c
cvs rdiff -u -r1.39 -r1.40 src/sbin/route/show.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/getnameinfo.c
diff -u src/lib/libc/net/getnameinfo.c:1.47 src/lib/libc/net/getnameinfo.c:1.48
--- src/lib/libc/net/getnameinfo.c:1.47	Wed Aug 12 20:24:30 2009
+++ src/lib/libc/net/getnameinfo.c	Tue Jan 26 21:27:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: getnameinfo.c,v 1.47 2009/08/12 20:24:30 seanb Exp $	*/
+/*	$NetBSD: getnameinfo.c,v 1.48 2010/01/26 21:27:54 is Exp $	*/
 /*	$KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $	*/
 
 /*
@@ -47,7 +47,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getnameinfo.c,v 1.47 2009/08/12 20:24:30 seanb Exp $);
+__RCSID($NetBSD: getnameinfo.c,v 1.48 2010/01/26 21:27:54 is Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -57,6 +57,7 @@
 #include net/if_dl.h
 #include net/if_ieee1394.h
 #include net/if_types.h
+#include netatalk/at.h
 #include netinet/in.h
 #include arpa/inet.h
 #include arpa/nameser.h
@@ -102,6 +103,9 @@
 static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t,
  int));
 #endif
+static int getnameinfo_atalk __P((const struct sockaddr *, socklen_t, char *,
+socklen_t, char *, socklen_t, int));
+
 static int getnameinfo_link __P((const struct sockaddr *, socklen_t, char *,
 socklen_t, char *, socklen_t, int));
 static int hexname __P((const u_int8_t *, size_t, char *, socklen_t));
@@ -120,6 +124,9 @@
 {
 
 	switch (sa-sa_family) {
+	case AF_APPLETALK:
+		return getnameinfo_atalk(sa, salen, host, hostlen,
+		serv, servlen, flags);
 	case AF_INET:
 	case AF_INET6:
 		return getnameinfo_inet(sa, salen, host, hostlen,
@@ -132,6 +139,45 @@
 	}
 }
 
+/*
+ * getnameinfo_atalk():
+ * Format an AppleTalk address into a printable format.
+ */
+/* ARGSUSED */
+static int
+getnameinfo_atalk(const struct sockaddr *sa, socklen_t salen,
+char *host, socklen_t hostlen, char *serv, socklen_t servlen,
+int flags)
+{
+	char numserv[8];
+	int n;
+
+	const struct sockaddr_at *sat =
+	(const struct sockaddr_at *)(const void *)sa;
+
+	if (serv != NULL  servlen  0) {
+		snprintf(numserv, sizeof(numserv), %u, sat-sat_port);
+		if (strlen(numserv) + 1  servlen)
+			return EAI_MEMORY;
+		strlcpy(serv, numserv, servlen);
+	}
+
+	if (sat-sat_range.r_netrange.nr_phase) {
+	n = snprintf(host, hostlen, %u.%u phase %u,
+		ntohs(sat-sat_addr.s_net), sat-sat_addr.s_node,
+			sat-sat_range.r_netrange.nr_phase);
+	} else {
+	n = snprintf(host, hostlen, %u.%u,
+		ntohs(sat-sat_addr.s_net), sat-sat_addr.s_node);
+	}
+
+	if (n  0 || (socklen_t) n = hostlen) {
+		if (host != NULL  hostlen  0)
+			*host = '\0';	/* XXX ??? */
+		return EAI_MEMORY;
+	}
+	return 0;
+}
 
 /*
  * getnameinfo_inet():

Index: src/sbin/route/show.c
diff -u src/sbin/route/show.c:1.39 src/sbin/route/show.c:1.40
--- src/sbin/route/show.c:1.39	Tue Mar 17 00:53:42 2009
+++ src/sbin/route/show.c	Tue Jan 26 21:27:54 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.39 2009/03/17 00:53:42 lukem Exp $	*/
+/*	$NetBSD: show.c,v 1.40 2010/01/26 21:27:54 is Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = from: @(#)route.c	8.3 (Berkeley) 3/9/94;
 #else
-__RCSID($NetBSD: show.c,v 1.39 2009/03/17 00:53:42 lukem Exp $);
+__RCSID($NetBSD: show.c,v 1.40 2010/01/26 21:27:54 is Exp $);
 #endif
 #endif /* not lint */
 
@@ -363,6 +363,13 @@
 #endif /* INET6 */
 
 #ifndef SMALL
+	case AF_APPLETALK:
+		if (getnameinfo(sa, sa-sa_len, workbuf, sizeof(workbuf),
+		NULL, 0, NI_NUMERICHOST) != 0)
+			strlcpy(workbuf, invalid, sizeof(workbuf));
+		cp = workbuf;
+		break;
+
 #endif /* SMALL */
 
 	default:



CVS commit: src/sys/fs

2010-01-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 26 21:29:48 UTC 2010

Modified Files:
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/msdosfs: msdosfs_vfsops.c

Log Message:
Drop two uses of disk label data.

msdosfs and cd9660 are the only filesystems that verify the filesystem
type in the label. This is the wrong place, sanity checks should only
rely on the inner structure of the filesystem (like signatures or
magic numbers).

msdosfs also used the device type information from the label to
deduce a filesystem parameter heuristically for the gemdos variant.
If there is no information inside the filesystem data itself, this
should be an explicit mount option.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.77 -r1.78 src/sys/fs/msdosfs/msdosfs_vfsops.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/cd9660/cd9660_vfsops.c
diff -u src/sys/fs/cd9660/cd9660_vfsops.c:1.69 src/sys/fs/cd9660/cd9660_vfsops.c:1.70
--- src/sys/fs/cd9660/cd9660_vfsops.c:1.69	Fri Jan  8 11:35:08 2010
+++ src/sys/fs/cd9660/cd9660_vfsops.c	Tue Jan 26 21:29:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_vfsops.c,v 1.69 2010/01/08 11:35:08 pooka Exp $	*/
+/*	$NetBSD: cd9660_vfsops.c,v 1.70 2010/01/26 21:29:48 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cd9660_vfsops.c,v 1.69 2010/01/08 11:35:08 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: cd9660_vfsops.c,v 1.70 2010/01/26 21:29:48 mlelstv Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -368,8 +368,7 @@
 	iso_bsize = ISO_DEFAULT_BLOCK_SIZE;
 
 	error = VOP_IOCTL(devvp, DIOCGDINFO, label, FREAD, FSCRED);
-	if (!error 
-	label.d_partitions[DISKPART(dev)].p_fstype == FS_ISO9660) {
+	if (!error) {
 		/* XXX more sanity checks? */
 		sess = label.d_partitions[DISKPART(dev)].p_cdsession;
 	} else {

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.77 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.78
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.77	Mon Jan 25 15:30:44 2010
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Tue Jan 26 21:29:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.77 2010/01/25 15:30:44 mlelstv Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.78 2010/01/26 21:29:48 mlelstv Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.77 2010/01/25 15:30:44 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: msdosfs_vfsops.c,v 1.78 2010/01/26 21:29:48 mlelstv Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -471,7 +471,7 @@
 	struct byte_bpb710 *b710;
 	u_int8_t SecPerClust;
 	int	ronly, error, tmp;
-	int	bsize, dtype, fstype, secsize;
+	int	bsize, secsize;
 	u_int64_t psize;
 
 	/* Flush out any old buffers remaining from a previous use. */
@@ -485,9 +485,7 @@
 
 	/*
  	 * We need the disklabel to calculate the size of a FAT entry
-	 * later on. Also make sure the partition contains a filesystem
-	 * of type FS_MSDOS. This doesn't work for floppies, so we have
-	 * to check for them too.
+	 * later on.
  	 *
  	 * There might still be parts of the msdos fs driver which assume
 	 * that the size of a disk block will always be 512 bytes.
@@ -496,16 +494,12 @@
 	error = VOP_IOCTL(devvp, DIOCGPART, dpart, FREAD, NOCRED);
 	if (error == 0) {
 		secsize = dpart.disklab-d_secsize;
-		dtype = dpart.disklab-d_type;
-		fstype = dpart.part-p_fstype;
 		psize = dpart.part-p_size;
 	} else {
 		struct dkwedge_info dkw;
 		struct disk *pdk;
 		error = VOP_IOCTL(devvp, DIOCGWEDGEINFO, dkw, FREAD, NOCRED);
 		secsize = 512;	/* XXX */
-		dtype = DTYPE_FLOPPY; /* XXX */
-		fstype = FS_MSDOS;
 		psize = -1;
 		if (error) {
 			if (error != ENOTTY) {
@@ -520,16 +514,13 @@
 goto error_exit;
 			}
 			secsize = DEV_BSIZE  pdk-dk_blkshift;
-			fstype = strcmp(dkw.dkw_ptype, DKW_PTYPE_FAT) == 0 ?
-			FS_MSDOS : -1;
 			psize = dkw.dkw_size;
 		}
 	}
 	if (argp-flags  MSDOSFSMNT_GEMDOSFS) {
 		bsize = secsize;
 		if (bsize != 512) {
-			DPRINTF((bsize %d dtype %d fstype %d\n, bsize, dtype,
-			fstype));
+			DPRINTF((Invalid block bsize %d for gemdos\n, bsize));
 			error = EINVAL;
 			goto error_exit;
 		}
@@ -696,11 +687,7 @@
 	pmp-pm_fatsize = pmp-pm_FATsecs * pmp-pm_BytesPerSec;
 
 	if (argp-flags  MSDOSFSMNT_GEMDOSFS) {
-		if (pmp-pm_nmbrofclusters = (0xff0 - 2)
-		   (dtype == DTYPE_FLOPPY
-			  || (dtype == DTYPE_VND
- (pmp-pm_Heads == 1 || pmp-pm_Heads == 2)))
-		) {
+		if (pmp-pm_nmbrofclusters = (0xff0 - 2)) {
 			pmp-pm_fatmask = FAT12_MASK;
 			pmp-pm_fatmult = 3;
 			pmp-pm_fatdiv = 2;



CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 21:37:02 UTC 2010

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

Log Message:
Move the complete prototypes to the SYNOPSIS. Also capitalize the titles.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/share/man/man9/fileassoc.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/fileassoc.9
diff -u src/share/man/man9/fileassoc.9:1.22 src/share/man/man9/fileassoc.9:1.23
--- src/share/man/man9/fileassoc.9:1.22	Sun Sep 14 12:51:39 2008
+++ src/share/man/man9/fileassoc.9	Tue Jan 26 21:37:02 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: fileassoc.9,v 1.22 2008/09/14 12:51:39 itohy Exp $
+.\ $NetBSD: fileassoc.9,v 1.23 2010/01/26 21:37:02 jruoho Exp $
 .\
 .\ Copyright (c) 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -33,6 +33,26 @@
 .Nd in-kernel, file-system independent, file-meta data association
 .Sh SYNOPSIS
 .In sys/fileassoc.h
+.Ft int
+.Fn fileassoc_register const char *name \
+fileassoc_cleanup_cb_t cleanup_cb fileassoc_t *result
+.Ft int
+.Fn fileassoc_deregister fileassoc_t id
+.Ft void *
+.Fn fileassoc_lookup struct vnode *vp fileassoc_t id
+.Ft int
+.Fn fileassoc_table_delete struct mount *mp
+.Ft int
+.Fn fileassoc_table_clear struct mount *mp fileassoc_t id
+.Ft int
+.Fn fileassoc_table_run struct mount *mp fileassoc_t id \
+fileassoc_cb_t cb void *cookie
+.Ft int
+.Fn fileassoc_file_delete struct vnode *vp
+.Ft int
+.Fn fileassoc_add struct vnode *vp fileassoc_t id void *data
+.Ft int
+.Fn fileassoc_clear struct vnode *vp fileassoc_t id
 .Sh DESCRIPTION
 The
 .Nm
@@ -45,7 +65,7 @@
 .Pp
 For example, a developer might choose to associate a custom ACL with every
 file, and a count of total files with ACLs with the mount.
-.Ss Kernel Programming Interface
+.Sh KERNEL PROGRAMMING INTERFACE
 Designed with simplicity in mind, the
 .Nm
 KPI usually accepts four different types of parameters to the most commonly
@@ -78,13 +98,12 @@
 .Fn fileassoc_register
 (see below)
 to be called whenever an entry for a file or a mount is deleted.
-.Ss Fileassoc Registration and Deregistration Routines
+.Ss REGISTRATION AND DEREGISTRATION ROUTINES
 These routines allow a developer to allocate a
 .Nm
 slot to be used for private data.
 .Bl -tag -width 123456
-.It Ft int Fn fileassoc_register const char *name \
-fileassoc_cleanup_cb_t cleanup_cb fileassoc_t *result
+.It Fn fileassoc_register name cleanup_cb result
 Registers a new fileassoc as
 .Ar name ,
 and returns a
@@ -115,7 +134,7 @@
 .Sx EXAMPLES
 section for illustration.
 .Pp
-.It Ft int Fn fileassoc_deregister fileassoc_t id
+.It Fn fileassoc_deregister id
 Deregisters a
 .Nm fileassoc
 whose id is
@@ -128,24 +147,24 @@
 subsystem.
 It is up to the developer to take care of garbage collection.
 .El
-.Ss Lookup Routines
+.Ss LOOKUP ROUTINES
 These routines allow lookup of
 .Nm
 mounts, files, and private data attached to them.
 .Bl -tag -width 123456
-.It Ft void * Fn fileassoc_lookup struct vnode *vp fileassoc_t id
+.It Fn fileassoc_lookup vp id
 Returns the private data for the file/id combination
 or
 .Dv NULL
 if not found.
 .El
-.Ss Mount-wide Routines
+.Ss MOUNT-WIDE ROUTINES
 .Bl -tag -width 123456
-.It Ft int Fn fileassoc_table_delete struct mount *mp
+.It Fn fileassoc_table_delete mp
 Deletes a fileassoc table for
 .Ar mp .
 .Pp
-.It Ft int Fn fileassoc_table_clear struct mount *mp fileassoc_t id
+.It Fn fileassoc_table_clear mp id
 Clear all table entries for
 .Ar fileassoc
 from
@@ -155,8 +174,7 @@
 .Dq cleanup routine
 will be called with a pointer to the private data-structure.
 .Pp
-.It Ft int Fn fileassoc_table_run struct mount *mp fileassoc_t id \
-fileassoc_cb_t cb void *cookie
+.It Fn fileassoc_table_run mp id cb cookie
 For each entry for
 .Ar id ,
 call
@@ -172,9 +190,9 @@
 .Ft void *
 parameter.
 .El
-.Ss File-specific Routines
+.Ss FILE-SPECIFIC ROUTINES
 .Bl -tag -width 123456
-.It Ft int Fn fileassoc_file_delete struct vnode *vp
+.It Fn fileassoc_file_delete vp
 Delete the fileassoc entries for
 .Ar vp .
 .Pp
@@ -186,7 +204,7 @@
 .El
 .Ss Fileassoc-specific Routines
 .Bl -tag -width 123456
-.It Ft int Fn fileassoc_add struct vnode *vp fileassoc_t id void *data
+.It Fn fileassoc_add vp id data
 Add private data in
 .Ar data
 for
@@ -199,7 +217,7 @@
 is on doesn't exist, one will be created automatically.
 .Nm
 manages internally the optimal table sizes as tables are modified.
-.It Ft int Fn fileassoc_clear struct vnode *vp fileassoc_t id
+.It Fn fileassoc_clear vp id
 Clear the private data for
 .Ar vp ,
 for the fileassoc specified by



CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 21:40:34 UTC 2010

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

Log Message:
Capitalize one more title. Use a complete sentence in CODE REFERENCES.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man9/fileassoc.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/fileassoc.9
diff -u src/share/man/man9/fileassoc.9:1.23 src/share/man/man9/fileassoc.9:1.24
--- src/share/man/man9/fileassoc.9:1.23	Tue Jan 26 21:37:02 2010
+++ src/share/man/man9/fileassoc.9	Tue Jan 26 21:40:34 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: fileassoc.9,v 1.23 2010/01/26 21:37:02 jruoho Exp $
+.\ $NetBSD: fileassoc.9,v 1.24 2010/01/26 21:40:34 jruoho Exp $
 .\
 .\ Copyright (c) 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -202,7 +202,7 @@
 private data structure and indication of
 .Dv FILEASSOC_CLEANUP_FILE .
 .El
-.Ss Fileassoc-specific Routines
+.Ss FILEASSOC-SPECIFIC ROUTINES
 .Bl -tag -width 123456
 .It Fn fileassoc_add vp id data
 Add private data in
@@ -330,7 +330,10 @@
 .Nm ,
 see the Veriexec code.
 .Sh CODE REFERENCES
-.Pa src/sys/kern/kern_fileassoc.c
+The
+.Nm
+is implemented within
+.Pa src/sys/kern/kern_fileassoc.c .
 .Sh HISTORY
 The
 .Nm



CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 21:50:57 UTC 2010

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

Log Message:
Give it a single name; it is sufficient to list the functions in the SYNOPSIS.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man9/pmf.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/pmf.9
diff -u src/share/man/man9/pmf.9:1.14 src/share/man/man9/pmf.9:1.15
--- src/share/man/man9/pmf.9:1.14	Wed Jan 20 07:27:21 2010
+++ src/share/man/man9/pmf.9	Tue Jan 26 21:50:57 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: pmf.9,v 1.14 2010/01/20 07:27:21 wiz Exp $
+.\ $NetBSD: pmf.9,v 1.15 2010/01/26 21:50:57 jruoho Exp $
 .\
 .\ Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
 .\ All rights reserved.
@@ -28,26 +28,7 @@
 .Dt PMF 9
 .Os
 .Sh NAME
-.Nm PMF ,
-.Nm pmf_device_register ,
-.Nm pmf_device_register1 ,
-.Nm pmf_device_deregister ,
-.Nm pmf_device_suspend ,
-.Nm pmf_device_resume ,
-.Nm pmf_device_recursive_suspend ,
-.Nm pmf_device_recursive_resume ,
-.Nm pmf_device_resume_subtree ,
-.Nm pmf_class_network_register ,
-.Nm pmf_class_input_register ,
-.Nm pmf_class_display_register ,
-.Nm pmf_system_suspend ,
-.Nm pmf_system_resume ,
-.Nm pmf_system_shutdown ,
-.Nm pmf_event_register ,
-.Nm pmf_event_deregister ,
-.Nm pmf_event_inject ,
-.Nm pmf_set_platform ,
-.Nm pmf_get_platform
+.Nm pmf
 .Nd power management and inter-driver messaging framework
 .Sh SYNOPSIS
 .In sys/device.h



CVS commit: src/regress/lib/libc/stdlib/posix_memalign

2010-01-26 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Jan 26 22:14:01 UTC 2010

Modified Files:
src/regress/lib/libc/stdlib/posix_memalign: posix_memalign.c

Log Message:
make this test actually work:
- posix_memalign() does not set errno, it returns 0 or an error number
  (maybe a jemalloc() vs. phkmalloc() issue, but also how the opengroup
  documents it.)
- since align must be = sizeof(void *), expect to fail align=4 on
  LP64 systems.
- while i'm here, add a test for align=2 failing everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/regress/lib/libc/stdlib/posix_memalign/posix_memalign.c

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

Modified files:

Index: src/regress/lib/libc/stdlib/posix_memalign/posix_memalign.c
diff -u src/regress/lib/libc/stdlib/posix_memalign/posix_memalign.c:1.2 src/regress/lib/libc/stdlib/posix_memalign/posix_memalign.c:1.3
--- src/regress/lib/libc/stdlib/posix_memalign/posix_memalign.c:1.2	Mon Apr 28 20:23:05 2008
+++ src/regress/lib/libc/stdlib/posix_memalign/posix_memalign.c	Tue Jan 26 22:14:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: posix_memalign.c,v 1.2 2008/04/28 20:23:05 martin Exp $	*/
+/*	$NetBSD: posix_memalign.c,v 1.3 2010/01/26 22:14:01 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,17 +29,33 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: posix_memalign.c,v 1.2 2008/04/28 20:23:05 martin Exp $);
+__RCSID($NetBSD: posix_memalign.c,v 1.3 2010/01/26 22:14:01 mrg Exp $);
 
 #include stdint.h
 #include stdlib.h
+#include errno.h
 #include err.h
+#include stdbool.h
 
-size_t size[] = {
-	1, 2, 3, 4, 10, 100, 16384
-};
-size_t align[] = {
-	512, 1024, 16, 32, 64, 4, 2048
+#ifdef _LP64
+#define FOURFAIL	true
+#else
+#define FOURFAIL	false
+#endif
+
+struct {
+	size_t	size;
+	size_t	align;
+	bool	fail;
+} testlist[] = {
+	{ 1, 512, false, },
+	{ 2, 1024, false, },
+	{ 3, 16, false, },
+	{ 4, 32, false, },
+	{ 10, 64, false, },
+	{ 100, 4, FOURFAIL, },
+	{ 10, 2, true, },
+	{ 16384, 2048, false, },
 };
 
 int
@@ -47,17 +63,24 @@
 {
 	size_t i;
 	void *p;
+	int error;
 
-	for (i = 0; i  __arraycount(size); i++) {
-		if (posix_memalign(p, align[i], size[i]) != 0)
-			err(1, a=%zu, s=%zu, align[i], size[i]);
-		if (((intptr_t)p)  (align[i] - 1))
-			errx(1, p=%p a=%zu, s=%zu, p, align[i], size[i]);
+	for (i = 0; i  __arraycount(testlist); i++) {
+		error = posix_memalign(p, testlist[i].align, testlist[i].size);
+		if (testlist[i].fail == false) {
+			if (error != 0) {
+errno = error;
+err(1, a=%zu, s=%zu, testlist[i].align, testlist[i].size);
+			}
+			if (((intptr_t)p)  (testlist[i].align - 1))
+errx(1, p=%p a=%zu, s=%zu, p, testlist[i].align, testlist[i].size);
+		} else if (error == 0)
+			errx(1, didn't fail: a=%zu, s=%zu, testlist[i].align, testlist[i].size);
 	}
 
 	/* This can fail */
 	if (posix_memalign(p, 32768, 16) == 0)
 		if (((intptr_t)p)  (32768 - 1))
-			errx(1, p=%p a=%zu, s=%zu, p, align[i], size[i]);
+			errx(1, p=%p a=%zu, s=%zu, p, 32768, 16);
 	return 0;
 }



CVS commit: src/share/man/man9

2010-01-26 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Tue Jan 26 22:35:11 UTC 2010

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

Log Message:
Revert previous.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/pmf.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/pmf.9
diff -u src/share/man/man9/pmf.9:1.15 src/share/man/man9/pmf.9:1.16
--- src/share/man/man9/pmf.9:1.15	Tue Jan 26 21:50:57 2010
+++ src/share/man/man9/pmf.9	Tue Jan 26 22:35:11 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: pmf.9,v 1.15 2010/01/26 21:50:57 jruoho Exp $
+.\ $NetBSD: pmf.9,v 1.16 2010/01/26 22:35:11 jruoho Exp $
 .\
 .\ Copyright (c) 2007 Jared D. McNeill jmcne...@invisible.ca
 .\ All rights reserved.
@@ -28,7 +28,26 @@
 .Dt PMF 9
 .Os
 .Sh NAME
-.Nm pmf
+.Nm PMF ,
+.Nm pmf_device_register ,
+.Nm pmf_device_register1 ,
+.Nm pmf_device_deregister ,
+.Nm pmf_device_suspend ,
+.Nm pmf_device_resume ,
+.Nm pmf_device_recursive_suspend ,
+.Nm pmf_device_recursive_resume ,
+.Nm pmf_device_resume_subtree ,
+.Nm pmf_class_network_register ,
+.Nm pmf_class_input_register ,
+.Nm pmf_class_display_register ,
+.Nm pmf_system_suspend ,
+.Nm pmf_system_resume ,
+.Nm pmf_system_shutdown ,
+.Nm pmf_event_register ,
+.Nm pmf_event_deregister ,
+.Nm pmf_event_inject ,
+.Nm pmf_set_platform ,
+.Nm pmf_get_platform
 .Nd power management and inter-driver messaging framework
 .Sh SYNOPSIS
 .In sys/device.h



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

2010-01-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jan 26 22:49:58 UTC 2010

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

Log Message:
Fix comment gimplish.


To generate a diff of this commit:
cvs rdiff -u -r1.179.16.13 -r1.179.16.14 src/sys/arch/mips/mips/pmap.c

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

Modified files:

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.13 src/sys/arch/mips/mips/pmap.c:1.179.16.14
--- src/sys/arch/mips/mips/pmap.c:1.179.16.13	Tue Jan 26 21:19:25 2010
+++ src/sys/arch/mips/mips/pmap.c	Tue Jan 26 22:49:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.179.16.13 2010/01/26 21:19:25 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.179.16.14 2010/01/26 22:49:58 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.179.16.13 2010/01/26 21:19:25 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.179.16.14 2010/01/26 22:49:58 snj Exp $);
 
 /*
  *	Manages physical address maps.
@@ -647,9 +647,9 @@
 
 #ifndef _LP64
 	/*
-	 * If we have more memory than can be mapped by KSEG0, we need allocate
-	 * enough VA so we can map pages with the right color (to avoid cache
-	 * alias problems).
+	 * If we have more memory than can be mapped by KSEG0, we need to
+	 * allocate enough VA so we can map pages with the right color
+	 * (to avoid cache alias problems).
 	 */
 	if (mips_avail_end  MIPS_KSEG1_START - MIPS_KSEG0_START) {
 		curcpu()-ci_pmap_dstbase = uvm_km_alloc(kernel_map,
@@ -2032,7 +2032,7 @@
 		if (last) {
 			/*
 			 * If this was the page's last mapping, we no longer
-			 * care about it execness.
+			 * care about its execness.
 			 */
 			pmap_clear_page_attributes(pg, PG_MD_EXECPAGE);
 			PMAP_COUNT(exec_uncached_remove);



CVS commit: src/sys/uvm

2010-01-26 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Jan 27 03:56:33 UTC 2010

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
uvm_pageinsert, uvm_pageremove: Pass the uboj, to/from which a pg is
inserted/removed, as an argument, because looking up a back-reference from
pg is redundant.  No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.152 src/sys/uvm/uvm_page.c:1.153
--- src/sys/uvm/uvm_page.c:1.152	Sat Nov  7 07:27:50 2009
+++ src/sys/uvm/uvm_page.c	Wed Jan 27 03:56:33 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.152 2009/11/07 07:27:50 cegger Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.153 2010/01/27 03:56:33 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.152 2009/11/07 07:27:50 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.153 2010/01/27 03:56:33 uebayasi Exp $);
 
 #include opt_ddb.h
 #include opt_uvmhist.h
@@ -156,8 +156,8 @@
  * local prototypes
  */
 
-static void uvm_pageinsert(struct vm_page *);
-static void uvm_pageremove(struct vm_page *);
+static void uvm_pageinsert(struct uvm_object *, struct vm_page *);
+static void uvm_pageremove(struct uvm_object *, struct vm_page *);
 
 /*
  * per-object tree of pages
@@ -256,10 +256,10 @@
 }
 
 static inline void
-uvm_pageinsert(struct vm_page *pg)
+uvm_pageinsert(struct uvm_object *uobj, struct vm_page *pg)
 {
-	struct uvm_object *uobj = pg-uobject;
 
+	KDASSERT(uobj != NULL);
 	uvm_pageinsert_tree(uobj, pg);
 	uvm_pageinsert_list(uobj, pg, NULL);
 }
@@ -310,10 +310,10 @@
 }
 
 static inline void
-uvm_pageremove(struct vm_page *pg)
+uvm_pageremove(struct uvm_object *uobj, struct vm_page *pg)
 {
-	struct uvm_object *uobj = pg-uobject;
 
+	KDASSERT(uobj != NULL);
 	uvm_pageremove_tree(uobj, pg);
 	uvm_pageremove_list(uobj, pg);
 }
@@ -1216,7 +1216,7 @@
 		atomic_inc_uint(uvmexp.anonpages);
 	} else {
 		if (obj) {
-			uvm_pageinsert(pg);
+			uvm_pageinsert(obj, pg);
 		}
 		pg-pqflags = 0;
 	}
@@ -1284,7 +1284,7 @@
 	 */
 
 	if (pg-uobject) {
-		uvm_pageremove(pg);
+		uvm_pageremove(pg-uobject, pg);
 	}
 
 	/*
@@ -1294,7 +1294,7 @@
 	if (newobj) {
 		pg-uobject = newobj;
 		pg-offset = newoff;
-		uvm_pageinsert(pg);
+		uvm_pageinsert(newobj, pg);
 	}
 }
 
@@ -1386,7 +1386,7 @@
 		 */
 
 		if (pg-uobject != NULL) {
-			uvm_pageremove(pg);
+			uvm_pageremove(pg-uobject, pg);
 			pg-flags = ~PG_CLEAN;
 		} else if (pg-uanon != NULL) {
 			if ((pg-pqflags  PQ_ANON) == 0) {
@@ -1419,7 +1419,7 @@
 	 */
 
 	if (pg-uobject != NULL) {
-		uvm_pageremove(pg);
+		uvm_pageremove(pg-uobject, pg);
 	} else if (pg-uanon != NULL) {
 		pg-uanon-an_page = NULL;
 		atomic_dec_uint(uvmexp.anonpages);



CVS commit: src/sys/sys

2010-01-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 27 04:36:34 UTC 2010

Modified Files:
src/sys/sys: envsys.h

Log Message:
Define sets of limits (including the set of all limits) symbolically.
These will be used in an upcoming change.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/sys/envsys.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/sys/envsys.h
diff -u src/sys/sys/envsys.h:1.27 src/sys/sys/envsys.h:1.28
--- src/sys/sys/envsys.h:1.27	Tue Jan 26 14:22:00 2010
+++ src/sys/sys/envsys.h	Wed Jan 27 04:36:34 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: envsys.h,v 1.27 2010/01/26 14:22:00 pgoyette Exp $ */
+/* $NetBSD: envsys.h,v 1.28 2010/01/27 04:36:34 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 1999, 2007 The NetBSD Foundation, Inc.
@@ -173,7 +173,10 @@
 #define	PROP_RFACT		0x0080
 
 #define	PROP_DRIVER_LIMITS	0x8000
-#define	PROP_LIMITS		0x003f
+#define	PROP_CAP_LIMITS		(PROP_BATTCAP | PROP_BATTWARN)
+#define	PROP_VAL_LIMITS		(PROP_CRITMAX | PROP_CRITMIN | \
+ PROP_WARNMAX | PROP_WARNMIN)
+#define	PROP_LIMITS		(PROP_CAP_LIMITS | PROP_VAL_LIMITS)
 
 /*
  * Compatibility with old interface. Only ENVSYS_GTREDATA



CVS commit: src/share/man/man9

2010-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 27 06:50:41 UTC 2010

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

Log Message:
Bump date for reorg.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/share/man/man9/fileassoc.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/fileassoc.9
diff -u src/share/man/man9/fileassoc.9:1.24 src/share/man/man9/fileassoc.9:1.25
--- src/share/man/man9/fileassoc.9:1.24	Tue Jan 26 21:40:34 2010
+++ src/share/man/man9/fileassoc.9	Wed Jan 27 06:50:40 2010
@@ -1,4 +1,4 @@
-.\ $NetBSD: fileassoc.9,v 1.24 2010/01/26 21:40:34 jruoho Exp $
+.\ $NetBSD: fileassoc.9,v 1.25 2010/01/27 06:50:40 wiz Exp $
 .\
 .\ Copyright (c) 2006 Elad Efrat e...@netbsd.org
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd May 15, 2007
+.Dd January 26, 2010
 .Dt FILEASSOC 9
 .Os
 .Sh NAME



CVS commit: src/usr.sbin/powerd

2010-01-26 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jan 27 06:52:24 UTC 2010

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

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/powerd/powerd.8

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

Modified files:

Index: src/usr.sbin/powerd/powerd.8
diff -u src/usr.sbin/powerd/powerd.8:1.21 src/usr.sbin/powerd/powerd.8:1.22
--- src/usr.sbin/powerd/powerd.8:1.21	Tue Jan 26 20:37:13 2010
+++ src/usr.sbin/powerd/powerd.8	Wed Jan 27 06:52:24 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: powerd.8,v 1.21 2010/01/26 20:37:13 jruoho Exp $
+.\	$NetBSD: powerd.8,v 1.22 2010/01/27 06:52:24 wiz Exp $
 .\
 .\ Copyright (c) 2003 Wasabi Systems, Inc.
 .\ All rights reserved.
@@ -33,7 +33,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 22, 2007
+.Dd January 26, 2010
 .Dt POWERD 8
 .Os
 .Sh NAME



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

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 27 06:52:48 UTC 2010

Modified Files:
src/compat [matt-nb5-mips64]: Makefile.md_subdir
src/compat/dirshack [matt-nb5-mips64]: Makefile

Log Message:
Make compat build more tolerant of large number of parallel jobs


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/compat/Makefile.md_subdir
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/compat/dirshack/Makefile

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

Modified files:

Index: src/compat/Makefile.md_subdir
diff -u src/compat/Makefile.md_subdir:1.1.2.1 src/compat/Makefile.md_subdir:1.1.2.2
--- src/compat/Makefile.md_subdir:1.1.2.1	Mon Dec 14 06:20:58 2009
+++ src/compat/Makefile.md_subdir	Wed Jan 27 06:52:47 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.md_subdir,v 1.1.2.1 2009/12/14 06:20:58 mrg Exp $
+#	$NetBSD: Makefile.md_subdir,v 1.1.2.2 2010/01/27 06:52:47 matt Exp $
 
 # list of subdirs
 
@@ -11,5 +11,5 @@
 .endif
 
 .if (${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el)
-MD_SUBDIR=	mips64/64 mips64/o32
+MD_SUBDIR=	mips64/64 .WAIT mips64/o32
 .endif

Index: src/compat/dirshack/Makefile
diff -u src/compat/dirshack/Makefile:1.1.2.2 src/compat/dirshack/Makefile:1.1.2.3
--- src/compat/dirshack/Makefile:1.1.2.2	Mon Dec 14 06:20:58 2009
+++ src/compat/dirshack/Makefile	Wed Jan 27 06:52:47 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1.2.2 2009/12/14 06:20:58 mrg Exp $
+#	$NetBSD: Makefile,v 1.1.2.3 2010/01/27 06:52:47 matt Exp $
 
 # hacky method to get compat multilib base objdirs created before
 # make tries to go create the subdirs used for builds.
@@ -22,7 +22,7 @@
 
 MAKEDIRTARGETENV=	BOOTSTRAP_SUBDIRS=
 
-SUBDIR=	${MD_SUBDIR:C/^/..\//}
+SUBDIR=	${MD_SUBDIR:N.WAIT:C/^/..\//}
 
 .endif	# make(obj)
 .endif	# MKCOMPAT != no



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

2010-01-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan 27 06:55:25 UTC 2010

Modified Files:
src/lib/libc/arch/mips/gen [matt-nb5-mips64]: Makefile.inc _setjmp.S
flt_rounds.c setjmp.S
src/lib/libc/compat/arch/mips/gen [matt-nb5-mips64]: compat_setjmp.S
src/lib/libc/gen [matt-nb5-mips64]: nlist_private.h
Added Files:
src/lib/libc/gen [matt-nb5-mips64]: fabs_ieee754.c

Log Message:
Don't use cfc1/ctc1 in softfloat.  Use the common fabs/modf/ldexp when
using softfloat.


To generate a diff of this commit:
cvs rdiff -u -r1.28.34.1 -r1.28.34.2 src/lib/libc/arch/mips/gen/Makefile.inc
cvs rdiff -u -r1.20.34.3 -r1.20.34.4 src/lib/libc/arch/mips/gen/_setjmp.S
cvs rdiff -u -r1.5 -r1.5.34.1 src/lib/libc/arch/mips/gen/flt_rounds.c
cvs rdiff -u -r1.17.34.3 -r1.17.34.4 src/lib/libc/arch/mips/gen/setjmp.S
cvs rdiff -u -r1.1.34.2 -r1.1.34.3 \
src/lib/libc/compat/arch/mips/gen/compat_setjmp.S
cvs rdiff -u -r0 -r1.1.2.1 src/lib/libc/gen/fabs_ieee754.c
cvs rdiff -u -r1.17 -r1.17.46.1 src/lib/libc/gen/nlist_private.h

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/arch/mips/gen/Makefile.inc
diff -u src/lib/libc/arch/mips/gen/Makefile.inc:1.28.34.1 src/lib/libc/arch/mips/gen/Makefile.inc:1.28.34.2
--- src/lib/libc/arch/mips/gen/Makefile.inc:1.28.34.1	Sat Sep  5 18:46:38 2009
+++ src/lib/libc/arch/mips/gen/Makefile.inc	Wed Jan 27 06:55:25 2010
@@ -1,6 +1,10 @@
-#	$NetBSD: Makefile.inc,v 1.28.34.1 2009/09/05 18:46:38 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.28.34.2 2010/01/27 06:55:25 matt Exp $
 
+.if ${MKSOFTFLOAT} == no
 SRCS+=	fabs.S ldexp.S modf.S
+.else
+SRCS+=	fabs_ieee754.c ldexp_ieee754.c modf_ieee754.c
+.endif
 
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c
@@ -11,9 +15,12 @@
 SRCS+=	signbitf_ieee754.c signbitd_ieee754.c
 
 SRCS+=	nanf.c
+SRCS+=	flt_rounds.c
 
-SRCS+=	flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
+.if ${MKSOFTFLOAT} == no
+SRCS+=	fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \
 	fpsetround.c fpsetsticky.c
+.endif
 
 SRCS+=	setjmp.S longjmp.c
 SRCS+=	_setjmp.S

Index: src/lib/libc/arch/mips/gen/_setjmp.S
diff -u src/lib/libc/arch/mips/gen/_setjmp.S:1.20.34.3 src/lib/libc/arch/mips/gen/_setjmp.S:1.20.34.4
--- src/lib/libc/arch/mips/gen/_setjmp.S:1.20.34.3	Sat Dec 12 19:08:57 2009
+++ src/lib/libc/arch/mips/gen/_setjmp.S	Wed Jan 27 06:55:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.20.34.3 2009/12/12 19:08:57 cliff Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.20.34.4 2010/01/27 06:55:25 matt Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@
 #if 0
 	RCSID(from: @(#)_setjmp.s	8.1 (Berkeley) 6/4/93)
 #else
-	RCSID($NetBSD: _setjmp.S,v 1.20.34.3 2009/12/12 19:08:57 cliff Exp $)
+	RCSID($NetBSD: _setjmp.S,v 1.20.34.4 2010/01/27 06:55:25 matt Exp $)
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -82,13 +82,14 @@
 #if defined(__mips_n32) || defined(__mips_n64)
 	REG_S	gp, _OFFSETOF_SC_REGS_GP(a0)	# newabi gp is callee-saved
 #endif
-	cfc1	v0, $31# too bad cant check if FP used
 	/*
 	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
 	 * In N64, FP registers F23 .. F31 are callee-saved.
 	 * In O32, FP registers F20 .. F23 are callee-saved.
 	 */
 #ifndef SOFTFLOAT_FOR_GCC
+	cfc1	v0, $31# too bad cant check if FP used
+	INT_S	v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 #if defined(__mips_n64) || defined(__mips_n32)
 	FP_S	$f30, _OFFSETOF_SC_FPREGS_F30(a0)
 	FP_S	$f28, _OFFSETOF_SC_FPREGS_F28(a0)
@@ -110,7 +111,6 @@
 	FP_S	$f31, _OFFSETOF_SC_FPREGS_F31(a0)
 #endif
 #endif	/* SOFTFLOAT_FOR_GCC */
-	INT_S	v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 	REG_EPILOGUE
 
 	j	ra
@@ -140,16 +140,16 @@
 	REG_L		gp, _OFFSETOF_SC_REGS_GP(a0)
 #endif
 	# get fpu status
-	INT_L		v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 	REG_L		sp, _OFFSETOF_SC_REGS_SP(a0)
 	REG_L		s8, _OFFSETOF_SC_REGS_S8(a0)
+#ifndef SOFTFLOAT_FOR_GCC
+	INT_L		v0, _OFFSETOF_SC_FPREGS_FCSR(a0)
 	ctc1		v0, $31
 	/*
 	 * In N32, FP registers F20, F22, F24, F26, F28, F30 are callee-saved.
 	 * In N64, FP registers F23 .. F31 are callee-saved.
 	 * In O32, FP registers F20 .. F23 are callee-saved.
 	 */
-#ifndef SOFTFLOAT_FOR_GCC
 #if defined(__mips_n64) || defined(__mips_n32)
 	FP_L	$f30, _OFFSETOF_SC_FPREGS_F30(a0)
 	FP_L	$f28, _OFFSETOF_SC_FPREGS_F28(a0)

Index: src/lib/libc/arch/mips/gen/flt_rounds.c
diff -u src/lib/libc/arch/mips/gen/flt_rounds.c:1.5 src/lib/libc/arch/mips/gen/flt_rounds.c:1.5.34.1
--- src/lib/libc/arch/mips/gen/flt_rounds.c:1.5	Sat Dec 24 23:10:08 2005
+++ src/lib/libc/arch/mips/gen/flt_rounds.c	Wed Jan 27 06:55:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+/*	$NetBSD: flt_rounds.c,v 1.5.34.1 2010/01/27 06:55:25 matt Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,10 +7,11 @@
 
 #include sys/cdefs.h
 #if 

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

2010-01-26 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Jan 27 07:45:19 UTC 2010

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_page.c

Log Message:
Remove JRT two line comment about cache interference since the
change specifically addresses general VIPT cache issue.  Need more
throughout comment cleanup about uvmexp.ncolor intent and significance.


To generate a diff of this commit:
cvs rdiff -u -r1.140.6.3.4.2 -r1.140.6.3.4.3 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.140.6.3.4.2 src/sys/uvm/uvm_page.c:1.140.6.3.4.3
--- src/sys/uvm/uvm_page.c:1.140.6.3.4.2	Tue Jan 26 21:26:28 2010
+++ src/sys/uvm/uvm_page.c	Wed Jan 27 07:45:19 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.2 2010/01/26 21:26:28 matt Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.3 2010/01/27 07:45:19 nisimura Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3.4.2 2010/01/26 21:26:28 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3.4.3 2010/01/27 07:45:19 nisimura Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -1084,8 +1084,6 @@
 	/*
 	 * This implements a global round-robin page coloring
 	 * algorithm.
-	 *
-	 * XXXJRT: What about virtually-indexed caches?
 	 */
 
 	ucpu = curcpu()-ci_data.cpu_uvm;