CVS commit: src/sys/arch/hppa/hppa

2012-01-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan  6 07:59:07 UTC 2012

Modified Files:
src/sys/arch/hppa/hppa: pmap.c

Log Message:
Make pmap_check_alias static


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/hppa/hppa/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/hppa/hppa/pmap.c
diff -u src/sys/arch/hppa/hppa/pmap.c:1.88 src/sys/arch/hppa/hppa/pmap.c:1.89
--- src/sys/arch/hppa/hppa/pmap.c:1.88	Fri Dec 30 07:41:58 2011
+++ src/sys/arch/hppa/hppa/pmap.c	Fri Jan  6 07:59:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.88 2011/12/30 07:41:58 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88 2011/12/30 07:41:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.89 2012/01/06 07:59:07 skrll Exp $");
 
 #include "opt_cputype.h"
 
@@ -227,7 +227,7 @@ void pmap_dump_table(pa_space_t, vaddr_t
 void pmap_dump_pv(paddr_t);
 #endif
 
-int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t);
+static int pmap_check_alias(struct vm_page *, vaddr_t, pt_entry_t);
 
 #define	IS_IOPAGE_P(pa)	((pa) >= HPPA_IOBEGIN)
 
@@ -515,7 +515,7 @@ pmap_dump_pv(paddr_t pa)
 }
 #endif
 
-int
+static int
 pmap_check_alias(struct vm_page *pg, vaddr_t va, pt_entry_t pte)
 {
 	struct vm_page_md * const md = VM_PAGE_TO_MD(pg);



CVS commit: src/distrib/utils/sysinst

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 22:18:36 UTC 2012

Modified Files:
src/distrib/utils/sysinst: defs.h disks.c label.c savenewlabel.c

Log Message:
we want the label name not the fstype name.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.121 -r1.122 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.60 -r1.61 src/distrib/utils/sysinst/label.c
cvs rdiff -u -r1.11 -r1.12 src/distrib/utils/sysinst/savenewlabel.c

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

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.159 src/distrib/utils/sysinst/defs.h:1.160
--- src/distrib/utils/sysinst/defs.h:1.159	Thu Jan  5 16:29:24 2012
+++ src/distrib/utils/sysinst/defs.h	Thu Jan  5 17:18:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.159 2012/01/05 21:29:24 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.160 2012/01/05 22:18:36 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -41,6 +41,8 @@
 #include 
 #include 
 
+const char *getfslabelname(uint8_t);
+
 static inline void *
 deconst(const void *p)
 {

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.121 src/distrib/utils/sysinst/disks.c:1.122
--- src/distrib/utils/sysinst/disks.c:1.121	Thu Jan  5 16:29:24 2012
+++ src/distrib/utils/sysinst/disks.c	Thu Jan  5 17:18:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.121 2012/01/05 21:29:24 christos Exp $ */
+/*	$NetBSD: disks.c,v 1.122 2012/01/05 22:18:36 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#define FSTYPENAMES
 #include 
 
 #include 
@@ -87,6 +88,14 @@ static void fixsb(const char *, const ch
 
 static const char *disk_names[] = { DISK_NAMES, "vnd", NULL };
 
+const char *
+getfslabelname(uint8_t f)
+{
+	if (f >= __arraycount(fstypenames) || fstypenames[f] == NULL)
+		return "invalid";
+	return fstypenames[f];
+}
+
 /* from src/sbin/atactl/atactl.c
  * extract_string: copy a block of bytes out of ataparams and make
  * a proper string out of it, truncating trailing spaces and preserving
@@ -455,7 +464,7 @@ fmt_fspart(menudesc *m, int ptn, void *a
 		else
 			desc = "FFSv1";
 	else
-		desc = getfstypename(p->pi_fstype);
+		desc = getfslabelname(p->pi_fstype);
 
 #ifdef PART_BOOT
 	if (ptn == PART_BOOT)

Index: src/distrib/utils/sysinst/label.c
diff -u src/distrib/utils/sysinst/label.c:1.60 src/distrib/utils/sysinst/label.c:1.61
--- src/distrib/utils/sysinst/label.c:1.60	Thu Jan  5 15:22:33 2012
+++ src/distrib/utils/sysinst/label.c	Thu Jan  5 17:18:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.60 2012/01/05 20:22:33 christos Exp $	*/
+/*	$NetBSD: label.c,v 1.61 2012/01/05 22:18:36 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.60 2012/01/05 20:22:33 christos Exp $");
+__RCSID("$NetBSD: label.c,v 1.61 2012/01/05 22:18:36 christos Exp $");
 #endif
 
 #include 
@@ -387,7 +387,7 @@ edit_ptn(menudesc *menu, void *arg)
 
 	if (all_fstype_menu == -1) {
 		for (i = 0; i < nelem(all_fstypes); i++) {
-			all_fstypes[i].opt_name = getfstypename(i);
+			all_fstypes[i].opt_name = getfslabelname(i);
 			all_fstypes[i].opt_menu = OPT_NOMENU;
 			all_fstypes[i].opt_flags = 0;
 			all_fstypes[i].opt_action = set_fstype;
@@ -487,7 +487,7 @@ set_ptn_label(menudesc *m, int opt, void
 			else
 c = "FFSv1";
 		else
-			c = getfstypename(p->pi_fstype);
+			c = getfslabelname(p->pi_fstype);
 		wprintw(m->mw, msg_string(MSG_fstype_fmt), c);
 		break;
 	case PTN_MENU_START:

Index: src/distrib/utils/sysinst/savenewlabel.c
diff -u src/distrib/utils/sysinst/savenewlabel.c:1.11 src/distrib/utils/sysinst/savenewlabel.c:1.12
--- src/distrib/utils/sysinst/savenewlabel.c:1.11	Thu Jan  5 16:29:25 2012
+++ src/distrib/utils/sysinst/savenewlabel.c	Thu Jan  5 17:18:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: savenewlabel.c,v 1.11 2012/01/05 21:29:25 christos Exp $	*/
+/*	$NetBSD: savenewlabel.c,v 1.12 2012/01/05 22:18:36 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: savenewlabel.c,v 1.11 2012/01/05 21:29:25 christos Exp $");
+__RCSID("$NetBSD: savenewlabel.c,v 1.12 2012/01/05 22:18:36 christos Exp $");
 #endif
 
 #include 
@@ -94,10 +94,10 @@ savenewlabel(partinfo *lp, int nparts)
 		scripting_fprintf(f, "\t:p%c#%" PRIu32 ":o%c#%" PRIu32
 		":t%c=%s:", 'a'+i, (uint32_t)bsdlabel[i].pi_size,
 		'a'+i, (uint32_t)bsdlabel[i].pi_offset, 'a'+i,
-		getfstypename(bsdlabel[i].pi_fstype));
+		getfslabelname(bsdlabel[i].pi_fstype));
 		if (PI_ISBSDFS(&bsdlabel[i]))
 			scripting_fprintf (f, "b%c#%" PRIu32 ":f%c#%" PRIu32
-			":ta=4.2BSD:", 'a'+i,
+			":", 'a'+i

CVS commit: src/sys/dev/pci

2012-01-05 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan  5 21:40:03 UTC 2012

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
turns out we can feed some radeons faster than they can process image uploads,
so make periodic stops to let the fifo drain a bit
now this works on my Blade 2500 with a 32MB XVR-100


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.50 src/sys/dev/pci/radeonfb.c:1.51
--- src/sys/dev/pci/radeonfb.c:1.50	Wed Jan  4 15:56:18 2012
+++ src/sys/dev/pci/radeonfb.c	Thu Jan  5 21:40:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.50 2012/01/04 15:56:18 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.51 2012/01/05 21:40:03 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.50 2012/01/04 15:56:18 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.51 2012/01/05 21:40:03 macallan Exp $");
 
 #include 
 #include 
@@ -2556,8 +2556,10 @@ radeonfb_putchar_aa32(void *cookie, int 
 	 * could process them, especially when doing the alpha blending stuff
 	 * along the way, so just make sure there's some room in the FIFO and
 	 * then hammer away
+	 * As it turns out we can, so make periodic stops to let the FIFO
+	 * drain.
 	 */
-	radeonfb_wait_fifo(sc, 10);
+	radeonfb_wait_fifo(sc, 20);
 	for (i = 0; i < ri->ri_fontscale; i++) {
 		aval = *data;
 		data++;
@@ -2573,6 +2575,8 @@ radeonfb_putchar_aa32(void *cookie, int 
 			(g & 0xff00) |
 			(b & 0xff00) >> 8;
 		}
+		if (i & 16)
+			radeonfb_wait_fifo(sc, 20);
 		PUT32(sc, RADEON_HOST_DATA0, pixel);
 	}
 }



CVS commit: src/distrib/utils/sysinst/arch

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 21:32:37 UTC 2012

Modified Files:
src/distrib/utils/sysinst/arch/emips: md.c
src/distrib/utils/sysinst/arch/hp300: md.c
src/distrib/utils/sysinst/arch/hp700: md.c
src/distrib/utils/sysinst/arch/mipsco: md.c
src/distrib/utils/sysinst/arch/mvme68k: md.c
src/distrib/utils/sysinst/arch/pmax: md.c
src/distrib/utils/sysinst/arch/sgimips: md.c
src/distrib/utils/sysinst/arch/sparc: md.c
src/distrib/utils/sysinst/arch/sparc64: md.c
src/distrib/utils/sysinst/arch/vax: md.c
src/distrib/utils/sysinst/arch/x68k: md.c

Log Message:
eliminate logging variable from md code.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/sysinst/arch/emips/md.c
cvs rdiff -u -r1.31 -r1.32 src/distrib/utils/sysinst/arch/hp300/md.c
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/sysinst/arch/hp700/md.c
cvs rdiff -u -r1.19 -r1.20 src/distrib/utils/sysinst/arch/mipsco/md.c
cvs rdiff -u -r1.26 -r1.27 src/distrib/utils/sysinst/arch/mvme68k/md.c
cvs rdiff -u -r1.66 -r1.67 src/distrib/utils/sysinst/arch/pmax/md.c
cvs rdiff -u -r1.28 -r1.29 src/distrib/utils/sysinst/arch/sgimips/md.c
cvs rdiff -u -r1.51 -r1.52 src/distrib/utils/sysinst/arch/sparc/md.c
cvs rdiff -u -r1.28 -r1.29 src/distrib/utils/sysinst/arch/sparc64/md.c
cvs rdiff -u -r1.38 -r1.39 src/distrib/utils/sysinst/arch/vax/md.c
cvs rdiff -u -r1.42 -r1.43 src/distrib/utils/sysinst/arch/x68k/md.c

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

Modified files:

Index: src/distrib/utils/sysinst/arch/emips/md.c
diff -u src/distrib/utils/sysinst/arch/emips/md.c:1.4 src/distrib/utils/sysinst/arch/emips/md.c:1.5
--- src/distrib/utils/sysinst/arch/emips/md.c:1.4	Fri Nov  4 07:27:02 2011
+++ src/distrib/utils/sysinst/arch/emips/md.c	Thu Jan  5 16:32:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.4 2011/11/04 11:27:02 martin Exp $	*/
+/*	$NetBSD: md.c,v 1.5 2012/01/05 21:32:35 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -70,14 +70,14 @@ md_get_info(void)
 
 	fd = open(dev_name, O_RDONLY, 0);
 	if (fd < 0) {
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Can't open %s\n", dev_name);
 		endwin();
 		fprintf(stderr, "Can't open %s\n", dev_name);
 		exit(1);
 	}
 	if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Can't read disklabel on %s.\n",
 dev_name);
 		endwin();

Index: src/distrib/utils/sysinst/arch/hp300/md.c
diff -u src/distrib/utils/sysinst/arch/hp300/md.c:1.31 src/distrib/utils/sysinst/arch/hp300/md.c:1.32
--- src/distrib/utils/sysinst/arch/hp300/md.c:1.31	Fri Nov  4 07:27:02 2011
+++ src/distrib/utils/sysinst/arch/hp300/md.c	Thu Jan  5 16:32:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.31 2011/11/04 11:27:02 martin Exp $ */
+/*	$NetBSD: md.c,v 1.32 2012/01/05 21:32:35 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -70,14 +70,14 @@ md_get_info(void)
 
 	fd = open(dev_name, O_RDONLY, 0);
 	if (fd < 0) {
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Can't open %s\n", dev_name);
 		endwin();
 		fprintf(stderr, "Can't open %s\n", dev_name);
 		exit(1);
 	}
 	if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Can't read disklabel on %s.\n",
 dev_name);
 		endwin();

Index: src/distrib/utils/sysinst/arch/hp700/md.c
diff -u src/distrib/utils/sysinst/arch/hp700/md.c:1.12 src/distrib/utils/sysinst/arch/hp700/md.c:1.13
--- src/distrib/utils/sysinst/arch/hp700/md.c:1.12	Fri Nov  4 07:27:02 2011
+++ src/distrib/utils/sysinst/arch/hp700/md.c	Thu Jan  5 16:32:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.12 2011/11/04 11:27:02 martin Exp $	*/
+/*	$NetBSD: md.c,v 1.13 2012/01/05 21:32:36 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -72,14 +72,14 @@ md_get_info(void)
 
 	fd = open(dev_name, O_RDONLY, 0);
 	if (fd < 0) {
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Can't open %s\n", dev_name);
 		endwin();
 		fprintf(stderr, "Can't open %s\n", dev_name);
 		exit(1);
 	}
 	if (ioctl(fd, DIOCGDINFO, &disklabel) == -1) {
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Can't read disklabel on %s.\n",
 dev_name);
 		endwin();

Index: src/distrib/utils/sysinst/arch/mipsco/md.c
diff -u src/distrib/utils/sysinst/arch/mipsco/md.c:1.19 src/distrib/utils/sysinst/arch/mipsco/md.c:1.20
--- src/distrib/utils/sysinst/arch/mipsco/md.c:1.19	Fri Nov  4 07:27:03 2011
+++ src/distrib/utils/sysinst/arch/mipsco/md.c	Thu Jan  5 16:32:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.19 2011/11/04 11:27:03 martin Exp $	*/
+/*	$NetBSD: md.c,v 1.20 2012/01/05 21:32:36 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -71,14 +71,14 @@ md_get_info(void)
 
 	fd = open(dev_name, O_RDONLY, 0);
 	if (fd < 0) {

CVS commit: src/distrib/utils/sysinst

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 21:29:25 UTC 2012

Modified Files:
src/distrib/utils/sysinst: defs.h disks.c main.c mbr.c net.c run.c
savenewlabel.c target.c util.c

Log Message:
eliminate useless booleans and use the file pointers as conditionals.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.120 -r1.121 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.61 -r1.62 src/distrib/utils/sysinst/main.c
cvs rdiff -u -r1.88 -r1.89 src/distrib/utils/sysinst/mbr.c
cvs rdiff -u -r1.127 -r1.128 src/distrib/utils/sysinst/net.c
cvs rdiff -u -r1.68 -r1.69 src/distrib/utils/sysinst/run.c
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/sysinst/savenewlabel.c
cvs rdiff -u -r1.53 -r1.54 src/distrib/utils/sysinst/target.c
cvs rdiff -u -r1.171 -r1.172 src/distrib/utils/sysinst/util.c

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

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.158 src/distrib/utils/sysinst/defs.h:1.159
--- src/distrib/utils/sysinst/defs.h:1.158	Thu Jan  5 16:22:49 2012
+++ src/distrib/utils/sysinst/defs.h	Thu Jan  5 16:29:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.158 2012/01/05 21:22:49 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.159 2012/01/05 21:29:24 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -231,8 +231,6 @@ const char *multname;
 
 /* loging variables */
 
-int logging;
-int scripting;
 FILE *logfp;
 FILE *script;
 

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.120 src/distrib/utils/sysinst/disks.c:1.121
--- src/distrib/utils/sysinst/disks.c:1.120	Thu Jan  5 16:22:49 2012
+++ src/distrib/utils/sysinst/disks.c	Thu Jan  5 16:29:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.120 2012/01/05 21:22:49 christos Exp $ */
+/*	$NetBSD: disks.c,v 1.121 2012/01/05 21:29:24 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -651,7 +651,7 @@ make_fstab(void)
 	/* Create the fstab. */
 	make_target_dir("/etc");
 	f = target_fopen("/etc/fstab", "w");
-	if (logging)
+	if (logfp)
 		(void)fprintf(logfp,
 		"Creating %s/etc/fstab.\n", target_prefix());
 	scripting_fprintf(NULL, "cat <%s/etc/fstab\n", target_prefix());
@@ -659,7 +659,7 @@ make_fstab(void)
 	if (f == NULL) {
 #ifndef DEBUG
 		msg_display(MSG_createfstab);
-		if (logging)
+		if (logfp)
 			(void)fprintf(logfp, "Failed to make /etc/fstab!\n");
 		process_menu(MENU_ok, NULL);
 		return 1;

Index: src/distrib/utils/sysinst/main.c
diff -u src/distrib/utils/sysinst/main.c:1.61 src/distrib/utils/sysinst/main.c:1.62
--- src/distrib/utils/sysinst/main.c:1.61	Fri Sep 16 11:42:28 2011
+++ src/distrib/utils/sysinst/main.c	Thu Jan  5 16:29:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.61 2011/09/16 15:42:28 joerg Exp $	*/
+/*	$NetBSD: main.c,v 1.62 2012/01/05 21:29:24 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -60,8 +60,6 @@ static void cleanup(void);
 static void process_f_flag(char *);
 
 static int exit_cleanly = 0;	/* Did we finish nicely? */
-int logging;			/* are we logging everything? */
-int scripting;			/* are we building a script? */
 FILE *logfp;			/* log file */
 FILE *script;			/* script file */
 
@@ -126,13 +124,10 @@ main(int argc, char **argv)
 	WINDOW *win;
 	int ch;
 
-	logging = 0; /* shut them off unless turned on by the user */
 	init();
 #ifdef DEBUG
 	log_flip();
 #endif
-	scripting = 0;
-
 	/* Check for TERM ... */
 	if (!getenv("TERM")) {
 		(void)fprintf(stderr,
@@ -407,16 +402,18 @@ cleanup(void)
 
 	endwin();
 
-	if (logging) {
+	if (logfp) {
 		fprintf(logfp, "Log ended at: %s\n", asctime(localtime(&tloc)));
 		fflush(logfp);
 		fclose(logfp);
+		logfp = NULL;
 	}
-	if (scripting) {
+	if (script) {
 		fprintf(script, "# Script ended at: %s\n",
 		asctime(localtime(&tloc)));
 		fflush(script);
 		fclose(script);
+		script = NULL;
 	}
 
 	if (!exit_cleanly)

Index: src/distrib/utils/sysinst/mbr.c
diff -u src/distrib/utils/sysinst/mbr.c:1.88 src/distrib/utils/sysinst/mbr.c:1.89
--- src/distrib/utils/sysinst/mbr.c:1.88	Mon Oct 17 12:35:22 2011
+++ src/distrib/utils/sysinst/mbr.c	Thu Jan  5 16:29:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbr.c,v 1.88 2011/10/17 16:35:22 mbalmer Exp $ */
+/*	$NetBSD: mbr.c,v 1.89 2012/01/05 21:29:24 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1287,7 +1287,7 @@ edit_mbr(mbr_info_t *mbri)
 			msg_display(MSG_ovrwrite);
 			process_menu(MENU_noyes, NULL);
 			if (!yesno) {
-if (logging)
+if (logfp)
 	(void)fprintf(logfp, "User answered no to destroy other data, aborting.\n");
 return 0;
 			}

Index: src/distrib/utils/sysinst/net.c
diff -u src/distrib/utils/sysinst/net.c:1.127 src/distrib/utils/sysinst/net.c:1.128
--- src/distrib/utils/sysinst/net.c:1.127	Mon Apr  4 04:30:13

CVS commit: src/distrib/utils/sysinst

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 21:22:49 UTC 2012

Modified Files:
src/distrib/utils/sysinst: defs.h disks.c savenewlabel.c target.c

Log Message:
- add printflike and fix the broken formats
- make sure we don't exceed the number of partitions we have


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.119 -r1.120 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.9 -r1.10 src/distrib/utils/sysinst/savenewlabel.c
cvs rdiff -u -r1.52 -r1.53 src/distrib/utils/sysinst/target.c

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

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.157 src/distrib/utils/sysinst/defs.h:1.158
--- src/distrib/utils/sysinst/defs.h:1.157	Thu Jan  5 15:21:35 2012
+++ src/distrib/utils/sysinst/defs.h	Thu Jan  5 16:22:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.157 2012/01/05 20:21:35 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.158 2012/01/05 21:22:49 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -384,8 +384,8 @@ int	config_network(void);
 void	mnt_net_config(void);
 
 /* From run.c */
-int	collect(int, char **, const char *, ...);
-int	run_program(int, const char *, ...);
+int	collect(int, char **, const char *, ...) __printflike(3, 4);
+int	run_program(int, const char *, ...) __printflike(2, 3);
 void	do_logging(void);
 int	do_system(const char *);
 
@@ -416,10 +416,10 @@ int	sanity_check(void);
 int	set_timezone(void);
 int	set_root_password(void);
 int	set_root_shell(void);
-void	scripting_fprintf(FILE *, const char *, ...);
-void	scripting_vfprintf(FILE *, const char *, va_list);
+void	scripting_fprintf(FILE *, const char *, ...) __printflike(2, 3);
+void	scripting_vfprintf(FILE *, const char *, va_list) __printflike(2, 0);
 void	add_rc_conf(const char *, ...);
-void	add_sysctl_conf(const char *, ...);
+void	add_sysctl_conf(const char *, ...) __printflike(1, 2);
 void	enable_rc_conf(void);
 void	set_sizemultname_cyl(void);
 void	set_sizemultname_meg(void);
@@ -437,7 +437,8 @@ const	char *target_expand(const char *);
 void	make_target_dir(const char *);
 void	append_to_target_file(const char *, const char *);
 void	echo_to_target_file(const char *, const char *);
-void	sprintf_to_target_file(const char *, const char *, ...);
+void	sprintf_to_target_file(const char *, const char *, ...)
+__printflike(2, 3);
 void	trunc_target_file(const char *);
 const	char *target_prefix(void);
 int	target_chdir(const char *);

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.119 src/distrib/utils/sysinst/disks.c:1.120
--- src/distrib/utils/sysinst/disks.c:1.119	Thu Jan  5 15:21:35 2012
+++ src/distrib/utils/sysinst/disks.c	Thu Jan  5 16:22:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.119 2012/01/05 20:21:35 christos Exp $ */
+/*	$NetBSD: disks.c,v 1.120 2012/01/05 21:22:49 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -668,7 +668,7 @@ make_fstab(void)
 #endif
 	}
 
-	scripting_fprintf(f, "# NetBSD /etc/fstab\n# See /usr/share/examples/"
+	scripting_fprintf(f, "# NetBSD %s/etc/fstab\n# See /usr/share/examples/"
 		"fstab/ for more examples.\n", target_prefix());
 	for (i = 0; i < getmaxpartitions(); i++) {
 		const char *s = "";

Index: src/distrib/utils/sysinst/savenewlabel.c
diff -u src/distrib/utils/sysinst/savenewlabel.c:1.9 src/distrib/utils/sysinst/savenewlabel.c:1.10
--- src/distrib/utils/sysinst/savenewlabel.c:1.9	Thu Jan  5 15:21:35 2012
+++ src/distrib/utils/sysinst/savenewlabel.c	Thu Jan  5 16:22:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: savenewlabel.c,v 1.9 2012/01/05 20:21:35 christos Exp $	*/
+/*	$NetBSD: savenewlabel.c,v 1.10 2012/01/05 21:22:49 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: savenewlabel.c,v 1.9 2012/01/05 20:21:35 christos Exp $");
+__RCSID("$NetBSD: savenewlabel.c,v 1.10 2012/01/05 21:22:49 christos Exp $");
 #endif
 
 #include 
@@ -76,7 +76,7 @@ savenewlabel(partinfo *lp, int nparts)
 		(void)fprintf(stderr, "Could not open /etc/disktab");
 		if (logging)
 			(void)fprintf(logfp,
-			"Failed to open /etc/diskabel for appending.\n");
+			"Failed to open /etc/disktab for appending.\n");
 		exit (1);
 	}
 	scripting_fprintf(f, "%s|NetBSD installation generated:\\\n", bsddiskname);
@@ -85,6 +85,11 @@ savenewlabel(partinfo *lp, int nparts)
 	scripting_fprintf(f, "\t:sc#%d:su#%" PRIu32 ":\\\n", dlhead*dlsec,
 	(uint32_t)dlsize);
 	scripting_fprintf(f, "\t:se#%d:%s\\\n", sectorsize, doessf);
+	if ((size_t)nparts > __arraycount(bsdlabel)) {
+		nparts = __arraycount(bsdlabel);
+		if (logging)
+			(void)fprintf(logfp, "nparts limited to %d.\n", nparts);
+	}
 	for (i = 0; i < nparts; i++) {
 		scripting_fprintf(f, "\t:p%c#%" PRIu32 ":o%c#%

CVS commit: src/distrib/utils/sysinst

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 20:22:33 UTC 2012

Modified Files:
src/distrib/utils/sysinst: label.c

Log Message:
kill unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/distrib/utils/sysinst/label.c

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

Modified files:

Index: src/distrib/utils/sysinst/label.c
diff -u src/distrib/utils/sysinst/label.c:1.59 src/distrib/utils/sysinst/label.c:1.60
--- src/distrib/utils/sysinst/label.c:1.59	Thu Jan  5 15:21:35 2012
+++ src/distrib/utils/sysinst/label.c	Thu Jan  5 15:22:33 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.59 2012/01/05 20:21:35 christos Exp $	*/
+/*	$NetBSD: label.c,v 1.60 2012/01/05 20:22:33 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.59 2012/01/05 20:21:35 christos Exp $");
+__RCSID("$NetBSD: label.c,v 1.60 2012/01/05 20:22:33 christos Exp $");
 #endif
 
 #include 
@@ -387,7 +387,6 @@ edit_ptn(menudesc *menu, void *arg)
 
 	if (all_fstype_menu == -1) {
 		for (i = 0; i < nelem(all_fstypes); i++) {
-			char buf[128];
 			all_fstypes[i].opt_name = getfstypename(i);
 			all_fstypes[i].opt_menu = OPT_NOMENU;
 			all_fstypes[i].opt_flags = 0;



CVS commit: src/distrib/utils/sysinst

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 20:21:35 UTC 2012

Modified Files:
src/distrib/utils/sysinst: defs.h disks.c label.c savenewlabel.c

Log Message:
use getfstypename from libutil.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.118 -r1.119 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.58 -r1.59 src/distrib/utils/sysinst/label.c
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/sysinst/savenewlabel.c

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

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.156 src/distrib/utils/sysinst/defs.h:1.157
--- src/distrib/utils/sysinst/defs.h:1.156	Thu Jan  5 14:43:59 2012
+++ src/distrib/utils/sysinst/defs.h	Thu Jan  5 15:21:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.156 2012/01/05 19:43:59 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.157 2012/01/05 20:21:35 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -40,7 +40,6 @@
 /* System includes needed for this. */
 #include 
 #include 
-const char *getfstypename(char *, size_t, uint8_t);
 
 static inline void *
 deconst(const void *p)

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.118 src/distrib/utils/sysinst/disks.c:1.119
--- src/distrib/utils/sysinst/disks.c:1.118	Thu Jan  5 14:43:59 2012
+++ src/distrib/utils/sysinst/disks.c	Thu Jan  5 15:21:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.118 2012/01/05 19:43:59 christos Exp $ */
+/*	$NetBSD: disks.c,v 1.119 2012/01/05 20:21:35 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -46,7 +46,6 @@
 #include 
 #include 
 #include 
-#define FSTYPENAMES
 #include 
 
 #include 
@@ -88,18 +87,6 @@ static void fixsb(const char *, const ch
 
 static const char *disk_names[] = { DISK_NAMES, "vnd", NULL };
 
-const char *
-getfstypename(char *buf, size_t len, uint8_t fstype)
-{
-	
-	if (fstype >= __arraycount(fstypenames) ||
-	fstypenames[fstype] == NULL)
-		snprintf(buf, len, "*unknown*%" PRIu8 "*", fstype);
-	else
-		strlcpy(buf, fstypenames[fstype], len);
-	return buf;
-}
-
 /* from src/sbin/atactl/atactl.c
  * extract_string: copy a block of bytes out of ataparams and make
  * a proper string out of it, truncating trailing spaces and preserving
@@ -447,7 +434,6 @@ fmt_fspart(menudesc *m, int ptn, void *a
 {
 	unsigned int poffset, psize, pend;
 	const char *desc;
-	char buf[128];
 	static const char *Yes, *No;
 	partinfo *p = bsdlabel + ptn;
 
@@ -469,7 +455,7 @@ fmt_fspart(menudesc *m, int ptn, void *a
 		else
 			desc = "FFSv1";
 	else
-		desc = getfstypename(buf, sizeof(buf), p->pi_fstype);
+		desc = getfstypename(p->pi_fstype);
 
 #ifdef PART_BOOT
 	if (ptn == PART_BOOT)

Index: src/distrib/utils/sysinst/label.c
diff -u src/distrib/utils/sysinst/label.c:1.58 src/distrib/utils/sysinst/label.c:1.59
--- src/distrib/utils/sysinst/label.c:1.58	Thu Jan  5 14:43:59 2012
+++ src/distrib/utils/sysinst/label.c	Thu Jan  5 15:21:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.58 2012/01/05 19:43:59 christos Exp $	*/
+/*	$NetBSD: label.c,v 1.59 2012/01/05 20:21:35 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.58 2012/01/05 19:43:59 christos Exp $");
+__RCSID("$NetBSD: label.c,v 1.59 2012/01/05 20:21:35 christos Exp $");
 #endif
 
 #include 
@@ -388,8 +388,7 @@ edit_ptn(menudesc *menu, void *arg)
 	if (all_fstype_menu == -1) {
 		for (i = 0; i < nelem(all_fstypes); i++) {
 			char buf[128];
-			all_fstypes[i].opt_name = strdup(getfstypename(buf,
-			sizeof(buf), i));
+			all_fstypes[i].opt_name = getfstypename(i);
 			all_fstypes[i].opt_menu = OPT_NOMENU;
 			all_fstypes[i].opt_flags = 0;
 			all_fstypes[i].opt_action = set_fstype;
@@ -474,7 +473,6 @@ set_ptn_label(menudesc *m, int opt, void
 {
 	partinfo *p = arg;
 	const char *c;
-	char buf[128];
 
 	if (m->opts[opt].opt_flags & OPT_IGNORE
 	&& (opt != PTN_MENU_END || p->pi_fstype == FS_UNUSED)) {
@@ -490,7 +488,7 @@ set_ptn_label(menudesc *m, int opt, void
 			else
 c = "FFSv1";
 		else
-			c = getfstypename(buf, sizeof(buf), p->pi_fstype);
+			c = getfstypename(p->pi_fstype);
 		wprintw(m->mw, msg_string(MSG_fstype_fmt), c);
 		break;
 	case PTN_MENU_START:

Index: src/distrib/utils/sysinst/savenewlabel.c
diff -u src/distrib/utils/sysinst/savenewlabel.c:1.8 src/distrib/utils/sysinst/savenewlabel.c:1.9
--- src/distrib/utils/sysinst/savenewlabel.c:1.8	Thu Jan  5 14:43:59 2012
+++ src/distrib/utils/sysinst/savenewlabel.c	Thu Jan  5 15:21:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: savenewlabel.c,v 1.8 2012/01/05 19:43:59 christos Exp $	*/
+/*	$NetBSD: savenewlabel.c,v 1.9 2012/01/05 20:21:35 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC

CVS commit: src/distrib/utils/sysinst

2012-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  5 19:43:59 UTC 2012

Modified Files:
src/distrib/utils/sysinst: defs.h disks.c label.c savenewlabel.c

Log Message:
- avoid dereferencing junk if fstype is out of bounds.
- kill mountnames since it is not used.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/distrib/utils/sysinst/defs.h
cvs rdiff -u -r1.117 -r1.118 src/distrib/utils/sysinst/disks.c
cvs rdiff -u -r1.57 -r1.58 src/distrib/utils/sysinst/label.c
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/sysinst/savenewlabel.c

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

Modified files:

Index: src/distrib/utils/sysinst/defs.h
diff -u src/distrib/utils/sysinst/defs.h:1.155 src/distrib/utils/sysinst/defs.h:1.156
--- src/distrib/utils/sysinst/defs.h:1.155	Fri Nov  4 07:27:00 2011
+++ src/distrib/utils/sysinst/defs.h	Thu Jan  5 14:43:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.155 2011/11/04 11:27:00 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.156 2012/01/05 19:43:59 christos Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -40,8 +40,7 @@
 /* System includes needed for this. */
 #include 
 #include 
-extern const char * const fstypenames[];
-extern const char * const mountnames[];
+const char *getfstypename(char *, size_t, uint8_t);
 
 static inline void *
 deconst(const void *p)

Index: src/distrib/utils/sysinst/disks.c
diff -u src/distrib/utils/sysinst/disks.c:1.117 src/distrib/utils/sysinst/disks.c:1.118
--- src/distrib/utils/sysinst/disks.c:1.117	Fri Nov  4 07:27:00 2011
+++ src/distrib/utils/sysinst/disks.c	Thu Jan  5 14:43:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.117 2011/11/04 11:27:00 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.118 2012/01/05 19:43:59 christos Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -47,10 +47,7 @@
 #include 
 #include 
 #define FSTYPENAMES
-#define MOUNTNAMES
-#define static
 #include 
-#undef static
 
 #include 
 #include 
@@ -91,6 +88,18 @@ static void fixsb(const char *, const ch
 
 static const char *disk_names[] = { DISK_NAMES, "vnd", NULL };
 
+const char *
+getfstypename(char *buf, size_t len, uint8_t fstype)
+{
+	
+	if (fstype >= __arraycount(fstypenames) ||
+	fstypenames[fstype] == NULL)
+		snprintf(buf, len, "*unknown*%" PRIu8 "*", fstype);
+	else
+		strlcpy(buf, fstypenames[fstype], len);
+	return buf;
+}
+
 /* from src/sbin/atactl/atactl.c
  * extract_string: copy a block of bytes out of ataparams and make
  * a proper string out of it, truncating trailing spaces and preserving
@@ -438,6 +447,7 @@ fmt_fspart(menudesc *m, int ptn, void *a
 {
 	unsigned int poffset, psize, pend;
 	const char *desc;
+	char buf[128];
 	static const char *Yes, *No;
 	partinfo *p = bsdlabel + ptn;
 
@@ -459,7 +469,7 @@ fmt_fspart(menudesc *m, int ptn, void *a
 		else
 			desc = "FFSv1";
 	else
-		desc = fstypenames[p->pi_fstype];
+		desc = getfstypename(buf, sizeof(buf), p->pi_fstype);
 
 #ifdef PART_BOOT
 	if (ptn == PART_BOOT)

Index: src/distrib/utils/sysinst/label.c
diff -u src/distrib/utils/sysinst/label.c:1.57 src/distrib/utils/sysinst/label.c:1.58
--- src/distrib/utils/sysinst/label.c:1.57	Tue Jul  5 21:20:03 2011
+++ src/distrib/utils/sysinst/label.c	Thu Jan  5 14:43:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.57 2011/07/06 01:20:03 mrg Exp $	*/
+/*	$NetBSD: label.c,v 1.58 2012/01/05 19:43:59 christos Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.57 2011/07/06 01:20:03 mrg Exp $");
+__RCSID("$NetBSD: label.c,v 1.58 2012/01/05 19:43:59 christos Exp $");
 #endif
 
 #include 
@@ -387,7 +387,9 @@ edit_ptn(menudesc *menu, void *arg)
 
 	if (all_fstype_menu == -1) {
 		for (i = 0; i < nelem(all_fstypes); i++) {
-			all_fstypes[i].opt_name = fstypenames[i];
+			char buf[128];
+			all_fstypes[i].opt_name = strdup(getfstypename(buf,
+			sizeof(buf), i));
 			all_fstypes[i].opt_menu = OPT_NOMENU;
 			all_fstypes[i].opt_flags = 0;
 			all_fstypes[i].opt_action = set_fstype;
@@ -472,6 +474,7 @@ set_ptn_label(menudesc *m, int opt, void
 {
 	partinfo *p = arg;
 	const char *c;
+	char buf[128];
 
 	if (m->opts[opt].opt_flags & OPT_IGNORE
 	&& (opt != PTN_MENU_END || p->pi_fstype == FS_UNUSED)) {
@@ -487,7 +490,7 @@ set_ptn_label(menudesc *m, int opt, void
 			else
 c = "FFSv1";
 		else
-			c = fstypenames[p->pi_fstype];
+			c = getfstypename(buf, sizeof(buf), p->pi_fstype);
 		wprintw(m->mw, msg_string(MSG_fstype_fmt), c);
 		break;
 	case PTN_MENU_START:

Index: src/distrib/utils/sysinst/savenewlabel.c
diff -u src/distrib/utils/sysinst/savenewlabel.c:1.7 src/distrib/utils/sysinst/savenewlabel.c:1.8
--- src/distrib/utils/sysinst/savenewlabel.c:1.7	Sun Sep 20 18:43:00 2009
+++ src/distrib/utils/sysinst/savenewlabel.c	Thu Jan  5 14:43:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: savenewlabel.c,v 1.7 2009/09/20 22:43:0

CVS commit: xsrc/external/mit/xorg-cf-files/dist

2012-01-05 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Thu Jan  5 19:27:36 UTC 2012

Modified Files:
xsrc/external/mit/xorg-cf-files/dist: NetBSD.cf

Log Message:
Do as the comment says: always include xorg.cf


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xorg-cf-files/dist/NetBSD.cf

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

Modified files:

Index: xsrc/external/mit/xorg-cf-files/dist/NetBSD.cf
diff -u xsrc/external/mit/xorg-cf-files/dist/NetBSD.cf:1.6 xsrc/external/mit/xorg-cf-files/dist/NetBSD.cf:1.7
--- xsrc/external/mit/xorg-cf-files/dist/NetBSD.cf:1.6	Mon Jan  2 14:54:42 2012
+++ xsrc/external/mit/xorg-cf-files/dist/NetBSD.cf	Thu Jan  5 14:27:36 2012
@@ -625,12 +625,6 @@ InstallManPageAliasesBase(file,destdir,a
 #define BuildXF86VidModeExt	NO
 #define BuildXF86DGA		NO
 #define BuildXInputExt		NO
-
-/*
- * Always include xorg.cf for GccAliasingArgs,
- * regardless of server support on this plattform
- */
-#include 
 #endif
 
 /*
@@ -697,3 +691,9 @@ sed 's/\.[0-9]*$$//'`
 #define HasDevRandom		YES
 #define RandomDeviceFile	/dev/urandom
 #endif
+
+/*
+ * Always include xorg.cf for GccAliasingArgs,
+ * regardless of server support on this plattform
+ */
+#include 



CVS commit: src/crypto/external/bsd/openssl/dist

2012-01-05 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Thu Jan  5 18:59:53 UTC 2012

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/x509: x509_vfy.c
src/crypto/external/bsd/openssl/dist/ssl: d1_srvr.c s3_lib.c s3_srvr.c

Log Message:
also pull in patches for older security problems (secadv_20110906.txt):
-rev.21358 for CRL verification vulnerability in OpenSSL (CVE-2011-3207)
-rev.21336 for TLS ephemeral ECDH crashes in OpenSSL (CVE-2011-3210)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c
cvs rdiff -u -r1.1.1.3 -r1.2 \
src/crypto/external/bsd/openssl/dist/ssl/d1_srvr.c
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c:1.1.1.3 src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c:1.1.1.3	Sun Jun  5 14:59:58 2011
+++ src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c	Thu Jan  5 18:59:51 2012
@@ -703,6 +703,7 @@ static int check_cert(X509_STORE_CTX *ct
 	x = sk_X509_value(ctx->chain, cnum);
 	ctx->current_cert = x;
 	ctx->current_issuer = NULL;
+	ctx->current_crl_score = 0;
 	ctx->current_reasons = 0;
 	while (ctx->current_reasons != CRLDP_ALL_REASONS)
 		{
@@ -2015,6 +2016,9 @@ int X509_STORE_CTX_init(X509_STORE_CTX *
 	ctx->error_depth=0;
 	ctx->current_cert=NULL;
 	ctx->current_issuer=NULL;
+	ctx->current_crl=NULL;
+	ctx->current_crl_score=0;
+	ctx->current_reasons=0;
 	ctx->tree = NULL;
 	ctx->parent = NULL;
 

Index: src/crypto/external/bsd/openssl/dist/ssl/d1_srvr.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/d1_srvr.c:1.1.1.3 src/crypto/external/bsd/openssl/dist/ssl/d1_srvr.c:1.2
--- src/crypto/external/bsd/openssl/dist/ssl/d1_srvr.c:1.1.1.3	Sun Jun  5 15:00:33 2011
+++ src/crypto/external/bsd/openssl/dist/ssl/d1_srvr.c	Thu Jan  5 18:59:53 2012
@@ -1024,12 +1024,11 @@ int dtls1_send_server_key_exchange(SSL *
 SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
 goto err;
 }
-			if (!EC_KEY_up_ref(ecdhp))
+			if ((ecdh = EC_KEY_dup(ecdhp)) == NULL)
 {
 SSLerr(SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE,ERR_R_ECDH_LIB);
 goto err;
 }
-			ecdh = ecdhp;
 
 			s->s3->tmp.ecdh=ecdh;
 			if ((EC_KEY_get0_public_key(ecdh) == NULL) ||

Index: src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c:1.6 src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c:1.7
--- src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c:1.6	Thu Jul  7 18:11:18 2011
+++ src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c	Thu Jan  5 18:59:53 2012
@@ -2563,11 +2563,17 @@ void ssl3_clear(SSL *s)
 		}
 #ifndef OPENSSL_NO_DH
 	if (s->s3->tmp.dh != NULL)
+		{
 		DH_free(s->s3->tmp.dh);
+		s->s3->tmp.dh = NULL;
+		}
 #endif
 #ifndef OPENSSL_NO_ECDH
 	if (s->s3->tmp.ecdh != NULL)
+		{
 		EC_KEY_free(s->s3->tmp.ecdh);
+		s->s3->tmp.ecdh = NULL;
+		}
 #endif
 
 	rp = s->s3->rbuf.buf;

Index: src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c
diff -u src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c:1.9 src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c:1.10
--- src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c:1.9	Thu Jan  5 17:32:02 2012
+++ src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c	Thu Jan  5 18:59:53 2012
@@ -858,9 +858,7 @@ int ssl3_check_client_hello(SSL *s)
 	if (s->s3->tmp.message_type == SSL3_MT_CLIENT_HELLO)
 		{
 		/* Throw away what we have done so far in the current handshake,
-		 * which will now be aborted. (A full SSL_clear would be too much.)
-		 * I hope that tmp.dh is the only thing that may need to be cleared
-		 * when a handshake is not completed ... */
+		 * which will now be aborted. (A full SSL_clear would be too much.) */
 #ifndef OPENSSL_NO_DH
 		if (s->s3->tmp.dh != NULL)
 			{
@@ -868,6 +866,13 @@ int ssl3_check_client_hello(SSL *s)
 			s->s3->tmp.dh = NULL;
 			}
 #endif
+#ifndef OPENSSL_NO_ECDH
+		if (s->s3->tmp.ecdh != NULL)
+			{
+			EC_KEY_free(s->s3->tmp.ecdh);
+			s->s3->tmp.ecdh = NULL;
+			}
+#endif
 		s->s3->flags |= SSL3_FLAGS_SGC_RESTART_DONE;
 		return 2;
 		}
@@ -1590,7 +1595,6 @@ int ssl3_send_server_key_exchange(SSL *s
 
 			if (s->s3->tmp.dh != NULL)
 {
-DH_free(dh);
 SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
 goto err;
 }
@@ -1651,7 +1655,6 @@ int ssl3_send_server_key_exchange(SSL *s
 
 			if (s->s3->tmp.ecdh != NULL)
 {
-EC_KEY_free(s->s3->tmp.ecdh); 
 SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR);
 goto err;
 }
@@ -1662,12 +1665,11 @@ int ssl3_send_server_key_exc

CVS commit: src/sys/arch/xen/xen

2012-01-05 Thread Jean-Yves Migeon
Module Name:src
Committed By:   jym
Date:   Thu Jan  5 18:11:51 UTC 2012

Modified Files:
src/sys/arch/xen/xen: balloon.c

Log Message:
Comment fix.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/xen/balloon.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/xen/xen/balloon.c
diff -u src/sys/arch/xen/xen/balloon.c:1.12 src/sys/arch/xen/xen/balloon.c:1.13
--- src/sys/arch/xen/xen/balloon.c:1.12	Mon Dec 26 20:26:38 2011
+++ src/sys/arch/xen/xen/balloon.c	Thu Jan  5 18:11:50 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: balloon.c,v 1.12 2011/12/26 20:26:38 jym Exp $ */
+/* $NetBSD: balloon.c,v 1.13 2012/01/05 18:11:50 jym Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
 #define BALLOONDEBUG 0
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: balloon.c,v 1.12 2011/12/26 20:26:38 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: balloon.c,v 1.13 2012/01/05 18:11:50 jym Exp $");
 
 #include 
 #include 
@@ -692,7 +692,7 @@ sysctl_kern_xen_balloon_min(SYSCTLFN_ARG
 	return 0;
 }
 
-/* Returns the current memory reservation of the domain */
+/* Returns the maximum memory reservation of the domain */
 static int
 sysctl_kern_xen_balloon_max(SYSCTLFN_ARGS)
 {



CVS commit: src/crypto/external/bsd/openssl/dist

2012-01-05 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Thu Jan  5 17:32:02 UTC 2012

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/x509v3: v3_addr.c
src/crypto/external/bsd/openssl/dist/engines/ccgost: gost2001_keyx.c
gost94_keyx.c
src/crypto/external/bsd/openssl/dist/ssl: d1_pkt.c s3_enc.c s3_srvr.c
ssl.h ssl3.h ssl_err.c

Log Message:
pull in some patches from upstream CVS, following secadv_20120104.txt:
-rev.21964 for DTLS Plaintext Recovery Attack (CVE-2011-4108)
-rev.21961 for Uninitialized SSL 3.0 Padding (CVE-2011-4576)
-rev.21456+21954 for Malformed RFC 3779 Data Can Cause Assertion Failures
 (CVE-2011-4577)
 (rev.21456 is not mentioned in the advisory, but there is code overlap)
-rev.21958 for SGC Restart DoS Attack (CVE-2011-4619)
-rev.21956 for Invalid GOST parameters DoS Attack (CVE-2012-0027)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/x509v3/v3_addr.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/engines/ccgost/gost2001_keyx.c \
src/crypto/external/bsd/openssl/dist/engines/ccgost/gost94_keyx.c
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/crypto/external/bsd/openssl/dist/ssl/d1_pkt.c \
src/crypto/external/bsd/openssl/dist/ssl/ssl.h \
src/crypto/external/bsd/openssl/dist/ssl/ssl_err.c
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssl/dist/ssl/s3_enc.c
cvs rdiff -u -r1.8 -r1.9 src/crypto/external/bsd/openssl/dist/ssl/s3_srvr.c
cvs rdiff -u -r1.1.1.3 -r1.2 src/crypto/external/bsd/openssl/dist/ssl/ssl3.h

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/x509v3/v3_addr.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/x509v3/v3_addr.c:1.1.1.2 src/crypto/external/bsd/openssl/dist/crypto/x509v3/v3_addr.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/x509v3/v3_addr.c:1.1.1.2	Sun Jun  5 15:00:02 2011
+++ src/crypto/external/bsd/openssl/dist/crypto/x509v3/v3_addr.c	Thu Jan  5 17:32:02 2012
@@ -142,12 +142,13 @@ unsigned int v3_addr_get_afi(const IPAdd
  * Expand the bitstring form of an address into a raw byte array.
  * At the moment this is coded for simplicity, not speed.
  */
-static void addr_expand(unsigned char *addr,
+static int addr_expand(unsigned char *addr,
 			const ASN1_BIT_STRING *bs,
 			const int length,
 			const unsigned char fill)
 {
-  OPENSSL_assert(bs->length >= 0 && bs->length <= length);
+  if (bs->length < 0 || bs->length > length)
+return 0;
   if (bs->length > 0) {
 memcpy(addr, bs->data, bs->length);
 if ((bs->flags & 7) != 0) {
@@ -159,6 +160,7 @@ static void addr_expand(unsigned char *a
 }
   }
   memset(addr + bs->length, fill, length - bs->length);
+  return 1;
 }
 
 /*
@@ -181,15 +183,13 @@ static int i2r_address(BIO *out,
 return 0;
   switch (afi) {
   case IANA_AFI_IPV4:
-if (bs->length > 4)
+if (!addr_expand(addr, bs, 4, fill))
   return 0;
-addr_expand(addr, bs, 4, fill);
 BIO_printf(out, "%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
 break;
   case IANA_AFI_IPV6:
-if (bs->length > 16)
+if (!addr_expand(addr, bs, 16, fill))
   return 0;
-addr_expand(addr, bs, 16, fill);
 for (n = 16; n > 1 && addr[n-1] == 0x00 && addr[n-2] == 0x00; n -= 2)
   ;
 for (i = 0; i < n; i += 2)
@@ -315,6 +315,12 @@ static int i2r_IPAddrBlocks(const X509V3
 /*
  * Sort comparison function for a sequence of IPAddressOrRange
  * elements.
+ *
+ * There's no sane answer we can give if addr_expand() fails, and an
+ * assertion failure on externally supplied data is seriously uncool,
+ * so we just arbitrarily declare that if given invalid inputs this
+ * function returns -1.  If this messes up your preferred sort order
+ * for garbage input, tough noogies.
  */
 static int IPAddressOrRange_cmp(const IPAddressOrRange *a,
 const IPAddressOrRange *b,
@@ -326,22 +332,26 @@ static int IPAddressOrRange_cmp(const IP
 
   switch (a->type) {
   case IPAddressOrRange_addressPrefix:
-addr_expand(addr_a, a->u.addressPrefix, length, 0x00);
+if (!addr_expand(addr_a, a->u.addressPrefix, length, 0x00))
+  return -1;
 prefixlen_a = addr_prefixlen(a->u.addressPrefix);
 break;
   case IPAddressOrRange_addressRange:
-addr_expand(addr_a, a->u.addressRange->min, length, 0x00);
+if (!addr_expand(addr_a, a->u.addressRange->min, length, 0x00))
+  return -1;
 prefixlen_a = length * 8;
 break;
   }
 
   switch (b->type) {
   case IPAddressOrRange_addressPrefix:
-addr_expand(addr_b, b->u.addressPrefix, length, 0x00);
+if (!addr_expand(addr_b, b->u.addressPrefix, length, 0x00))
+  return -1;
 prefixlen_b = addr_prefixlen(b->u.addressPrefix);
 break;
   case IPAddressOrRange_addressRange:
-addr_expand(addr_b, b->u.addressRange->min, length, 0x00);
+if (!addr_ex

CVS commit: src/sys/arch/x86/x86

2012-01-05 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Jan  5 17:26:57 UTC 2012

Modified Files:
src/sys/arch/x86/x86: syscall.c

Log Message:
Remove unused variable i accidently left standing


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/x86/syscall.c

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

Modified files:

Index: src/sys/arch/x86/x86/syscall.c
diff -u src/sys/arch/x86/x86/syscall.c:1.7 src/sys/arch/x86/x86/syscall.c:1.8
--- src/sys/arch/x86/x86/syscall.c:1.7	Thu Jan  5 17:18:02 2012
+++ src/sys/arch/x86/x86/syscall.c	Thu Jan  5 17:26:57 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.7 2012/01/05 17:18:02 reinoud Exp $	*/
+/*	$NetBSD: syscall.c,v 1.8 2012/01/05 17:26:57 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.7 2012/01/05 17:18:02 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.8 2012/01/05 17:26:57 reinoud Exp $");
 
 #include "opt_sa.h"
 
@@ -106,7 +106,6 @@ syscall(struct trapframe *frame)
 	const struct sysent *callp;
 	struct proc *p;
 	struct lwp *l;
-	struct vm_map *map;
 	int error;
 	register_t code, rval[2], rip_call;
 #ifdef __x86_64__



CVS commit: src/sys/arch/x86/x86

2012-01-05 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Jan  5 17:18:02 UTC 2012

Modified Files:
src/sys/arch/x86/x86: syscall.c

Log Message:
Oops, forgot to revert this patch too... thanks Greg for finding it :-/


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/x86/syscall.c

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

Modified files:

Index: src/sys/arch/x86/x86/syscall.c
diff -u src/sys/arch/x86/x86/syscall.c:1.6 src/sys/arch/x86/x86/syscall.c:1.7
--- src/sys/arch/x86/x86/syscall.c:1.6	Tue Dec 20 15:41:50 2011
+++ src/sys/arch/x86/x86/syscall.c	Thu Jan  5 17:18:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.c,v 1.6 2011/12/20 15:41:50 reinoud Exp $	*/
+/*	$NetBSD: syscall.c,v 1.7 2012/01/05 17:18:02 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.6 2011/12/20 15:41:50 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.7 2012/01/05 17:18:02 reinoud Exp $");
 
 #include "opt_sa.h"
 
@@ -129,32 +129,6 @@ syscall(struct trapframe *frame)
 	 */
 	rip_call = X86_TF_RIP(frame) - frame->tf_err;
 
-	/* are we allowed to execute system calls in this memory space? */
-	if (p->p_flag & PK_CHKNOSYSCALL) {
-		map = &(p->p_vmspace->vm_map);
-		vm_map_lock(map);
-
-		if (uvm_map_checkattr(map, rip_call, rip_call + frame->tf_err,
-	MAP_NOSYSCALLS)) {
-			ksiginfo_t ksi;
-
-			vm_map_unlock(map);
-			X86_TF_RIP(frame) = rip_call;
-
-			/* treat as illegal instruction */
-			KSI_INIT_TRAP(&ksi);
-			ksi.ksi_signo = SIGILL;
-			ksi.ksi_code = ILL_ILLTRP;
-			ksi.ksi_addr = (void *) X86_TF_RIP(frame);
-			ksi.ksi_trap = 0; /* XXX ? */
-			trapsignal(l, &ksi);
-			userret(l);
-			return;
-		}
-
-		vm_map_unlock(map);
-	}
-
 	code = X86_TF_RAX(frame) & (SYS_NSYSENT - 1);
 	callp = p->p_emul->e_sysent + code;
 



CVS commit: src/sbin/fsck_lfs

2012-01-05 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Thu Jan  5 16:18:01 UTC 2012

Modified Files:
src/sbin/fsck_lfs: pass6.c

Log Message:
Correct fragment extension calculation in pass6, to avoid putting
negative block counts on inodes during roll-forward.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_lfs/pass6.c

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

Modified files:

Index: src/sbin/fsck_lfs/pass6.c
diff -u src/sbin/fsck_lfs/pass6.c:1.23 src/sbin/fsck_lfs/pass6.c:1.24
--- src/sbin/fsck_lfs/pass6.c:1.23	Tue Feb 16 23:20:30 2010
+++ src/sbin/fsck_lfs/pass6.c	Thu Jan  5 16:18:00 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pass6.c,v 1.23 2010/02/16 23:20:30 mlelstv Exp $	 */
+/* $NetBSD: pass6.c,v 1.24 2012/01/05 16:18:00 perseant Exp $	 */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@ rfw_update_single(struct uvnode *vp, dad
 			ip->i_ffs1_blocks += frags;
 		else {
 			/* possible fragment truncation or extension */
-			ofrags = ip->i_lfs_fragsize[lbn];
+			ofrags = numfrags(fs, ip->i_lfs_fragsize[lbn]);
 			ip->i_ffs1_blocks += (frags - ofrags);
 		}
 		ip->i_ffs1_db[lbn] = ndaddr;



CVS commit: src

2012-01-05 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Thu Jan  5 15:19:53 UTC 2012

Modified Files:
src/lib/libc/sys: mmap.2
src/sys/sys: mman.h proc.h
src/sys/uvm: uvm_extern.h uvm_map.c uvm_mmap.c

Log Message:
Revert MAP_NOSYSCALLS patch.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libc/sys/mmap.2
cvs rdiff -u -r1.43 -r1.44 src/sys/sys/mman.h
cvs rdiff -u -r1.312 -r1.313 src/sys/sys/proc.h
cvs rdiff -u -r1.178 -r1.179 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.309 -r1.310 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.142 -r1.143 src/sys/uvm/uvm_mmap.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/sys/mmap.2
diff -u src/lib/libc/sys/mmap.2:1.46 src/lib/libc/sys/mmap.2:1.47
--- src/lib/libc/sys/mmap.2:1.46	Tue Dec 20 16:43:14 2011
+++ src/lib/libc/sys/mmap.2	Thu Jan  5 15:19:52 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mmap.2,v 1.46 2011/12/20 16:43:14 wiz Exp $
+.\"	$NetBSD: mmap.2,v 1.47 2012/01/05 15:19:52 reinoud Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -180,9 +180,6 @@ other processes using
 will be seen.
 .It Dv MAP_SHARED
 Modifications are shared.
-.It Dv MAP_NOSYSCALLS
-No system calls are to be allowed from within this mapped region.
-They instead generate an illegal instruction signal.
 .El
 .Pp
 The

Index: src/sys/sys/mman.h
diff -u src/sys/sys/mman.h:1.43 src/sys/sys/mman.h:1.44
--- src/sys/sys/mman.h:1.43	Tue Dec 20 15:39:35 2011
+++ src/sys/sys/mman.h	Thu Jan  5 15:19:52 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mman.h,v 1.43 2011/12/20 15:39:35 reinoud Exp $	*/
+/*	$NetBSD: mman.h,v 1.44 2012/01/05 15:19:52 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -98,14 +98,6 @@ typedef	__off_t		off_t;		/* file offset 
 #define	MAP_STACK	0x2000	/* allocated from memory, swap space (stack) */
 
 /*
- * Map attributes 0x0001 till 0x00ff
- */
-#define MAP_ATTR(n)		((n) << MAP_ATTRIB_SHIFT)
-#define MAP_ATTRIB_SHIFT	16
-#define MAP_ATTRIB_MASK		MAP_ATTR(0xff)
-#define MAP_NOSYSCALLS		MAP_ATTR(0x01) /* no syscalls allowed */
-
-/*
  * Alignment (expressed in log2).  Must be >= log2(PAGE_SIZE) and
  * < # bits in a pointer (26 (acorn26), 32 or 64).
  */

Index: src/sys/sys/proc.h
diff -u src/sys/sys/proc.h:1.312 src/sys/sys/proc.h:1.313
--- src/sys/sys/proc.h:1.312	Tue Dec 20 15:39:35 2011
+++ src/sys/sys/proc.h	Thu Jan  5 15:19:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.312 2011/12/20 15:39:35 reinoud Exp $	*/
+/*	$NetBSD: proc.h,v 1.313 2012/01/05 15:19:53 reinoud Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -353,7 +353,6 @@ struct proc {
 #define	PK_NOCLDWAIT	0x0002 /* No zombies if child dies */
 #define	PK_32		0x0004 /* 32-bit process (used on 64-bit kernels) */
 #define	PK_CLDSIGIGN	0x0008 /* Process is ignoring SIGCHLD */
-#define PK_CHKNOSYSCALL 0x0010 /* Process needs NOSYSCALL checking */
 #define	PK_MARKER	0x8000 /* Is a dummy marker process */
 
 /*

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.178 src/sys/uvm/uvm_extern.h:1.179
--- src/sys/uvm/uvm_extern.h:1.178	Thu Dec 22 13:12:50 2011
+++ src/sys/uvm/uvm_extern.h	Thu Jan  5 15:19:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.178 2011/12/22 13:12:50 reinoud Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.179 2012/01/05 15:19:53 reinoud Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -680,11 +680,6 @@ void			uvmspace_unshare(struct lwp *);
 
 void			uvm_whatis(uintptr_t, void (*)(const char *, ...));
 
-void			uvm_map_setattr(struct vm_map *, vaddr_t,
-			vaddr_t, uint32_t);
-bool			uvm_map_checkattr(struct vm_map *, vaddr_t,
-			vaddr_t, uint32_t);
-
 /* uvm_meter.c */
 int			uvm_sysctl(int *, u_int, void *, size_t *,
 			void *, size_t, struct proc *);

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.309 src/sys/uvm/uvm_map.c:1.310
--- src/sys/uvm/uvm_map.c:1.309	Thu Dec 22 13:12:50 2011
+++ src/sys/uvm/uvm_map.c	Thu Jan  5 15:19:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.309 2011/12/22 13:12:50 reinoud Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.310 2012/01/05 15:19:53 reinoud Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.309 2011/12/22 13:12:50 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.310 2012/01/05 15:19:53 reinoud Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -1672,7 +1672,6 @@ nomerge:
 		new_entry->protection = prot;
 		new_entry->max_protection = maxprot;
 		new_entry->inheritance = inherit;
-		new_entry->map_attrib = 0;		/* XXX could be passed too */
 		new_entry->wired_count = 0;
 		new_entry->advice = advice;
 		if (flags & UVM_FLAG_OVERLAY) {
@@ -4122,73 +4121,6 @@ uvm_map_checkprot(struct vm_map *map, va

CVS commit: src/sys/arch/usermode/modules/syscallemu

2012-01-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan  5 13:26:51 UTC 2012

Added Files:
src/sys/arch/usermode/modules/syscallemu: Makefile syscallemu.c
syscallemu.h syscallemu_i386.c

Log Message:
Add 'syscallemu' module, required by usermode kernel.

This module registers a syscall that takes a user_start and user_end address.
When a process calls SYS_syscallemu, the start and end address are recorded
and the syscall installs a filter on p->p_md.md_syscall. The filter then
uses the specified start and end addresses to determine where the syscall
should be routed (either host by calling the original md_syscall function,
or process by posting SIGILL).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/usermode/modules/syscallemu/Makefile \
src/sys/arch/usermode/modules/syscallemu/syscallemu.c \
src/sys/arch/usermode/modules/syscallemu/syscallemu.h \
src/sys/arch/usermode/modules/syscallemu/syscallemu_i386.c

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

Added files:

Index: src/sys/arch/usermode/modules/syscallemu/Makefile
diff -u /dev/null src/sys/arch/usermode/modules/syscallemu/Makefile:1.1
--- /dev/null	Thu Jan  5 13:26:51 2012
+++ src/sys/arch/usermode/modules/syscallemu/Makefile	Thu Jan  5 13:26:51 2012
@@ -0,0 +1,16 @@
+#	$NetBSD: Makefile,v 1.1 2012/01/05 13:26:51 jmcneill Exp $
+
+NETBSDSRCDIR?=	../../../../..
+
+S?=	${NETBSDSRCDIR}/sys
+M?=	${S}/modules
+
+.include "${M}/Makefile.inc"
+.include "${M}/Makefile.assym"
+
+KMOD=	syscallemu
+
+SRCS=	syscallemu.c
+SRCS+=	syscallemu_${MACHINE_ARCH}.c
+
+.include 
Index: src/sys/arch/usermode/modules/syscallemu/syscallemu.c
diff -u /dev/null src/sys/arch/usermode/modules/syscallemu/syscallemu.c:1.1
--- /dev/null	Thu Jan  5 13:26:51 2012
+++ src/sys/arch/usermode/modules/syscallemu/syscallemu.c	Thu Jan  5 13:26:51 2012
@@ -0,0 +1,187 @@
+/* $NetBSD: syscallemu.c,v 1.1 2012/01/05 13:26:51 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2012 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: syscallemu.c,v 1.1 2012/01/05 13:26:51 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "syscallemu.h"
+
+#if !defined(__HAVE_SYSCALL_INTERN)
+#error syscallemu requires __HAVE_SYSCALL_INTERN
+#endif
+
+static specificdata_key_t syscallemu_data_key;
+static unsigned int syscallemu_refcnt;
+
+static const struct syscall_package syscallemu_syscalls[] = {
+	{ SYS_syscallemu,	0, (sy_call_t *)sys_syscallemu	},
+	{ 0, 0, NULL },
+};
+
+struct syscallemu_data *
+syscallemu_getsce(struct proc *p)
+{
+	return proc_getspecific(p, syscallemu_data_key);
+}
+
+void
+syscallemu_setsce(struct proc *p, struct syscallemu_data *sce)
+{
+	proc_setspecific(p, syscallemu_data_key, sce);
+}
+
+/*
+ * specificdata destructor
+ */
+static void
+syscallemu_dtor(void *priv)
+{
+	struct syscallemu_data *sce = priv;
+
+	kmem_free(sce, sizeof(*sce));
+	atomic_dec_uint(&syscallemu_refcnt);
+}
+
+/*
+ * Allocate private storage for the syscallemu parameters and stash it
+ * in process specificdata. This can only be called once per process.
+ *
+ * Returns EINVAL if the specified start address falls after the end.
+ * Returns EACCESS if syscallemu has already been configured for this process.
+ */
+int
+sys_syscallemu(lwp_t *l, const struct sys_syscallemu_args *uap,
+register_t *retval)
+{
+	/* {
+		syscallarg(uintptr_t) user_start;
+		syscallarg(uintptr_t) user_end;
+	} */
+	vaddr_t user_start = (vaddr_t)SCARG(uap, user_start);
+	vaddr_t user_end = (vaddr_t)SCARG(uap, user_end);

CVS commit: src/sys/arch/usermode

2012-01-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan  5 12:12:58 UTC 2012

Modified Files:
src/sys/arch/usermode/conf: Makefile.usermode
src/sys/arch/usermode/include: thunk.h
src/sys/arch/usermode/usermode: pmap.c thunk.c

Log Message:
Get rid of MAP_NOSYSCALLS usage; now this relies on a separate kmod that
you can get here: http://www.netbsd.org/~jmcneill/syscallemu.tar


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/usermode/conf/Makefile.usermode
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/usermode/include/thunk.h
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/usermode/usermode/pmap.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/usermode/usermode/thunk.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/usermode/conf/Makefile.usermode
diff -u src/sys/arch/usermode/conf/Makefile.usermode:1.27 src/sys/arch/usermode/conf/Makefile.usermode:1.28
--- src/sys/arch/usermode/conf/Makefile.usermode:1.27	Sat Dec 31 21:24:07 2011
+++ src/sys/arch/usermode/conf/Makefile.usermode	Thu Jan  5 12:12:58 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.usermode,v 1.27 2011/12/31 21:24:07 christos Exp $
+# $NetBSD: Makefile.usermode,v 1.28 2012/01/05 12:12:58 jmcneill Exp $
 
 OPT_CPU_HOST=			%CPU_HOST%
 .if !empty(OPT_CPU_HOST)
@@ -35,6 +35,7 @@ CPPFLAGS+=-D__NetBSD__ -Wno-unused-but-s
 
 DEFCOPTS=	-fno-omit-frame-pointer
 CPPFLAGS+=	-Dusermode
+CPPFLAGS+=	-Dsyscall=kernel_syscall
 CPPFLAGS.init_main.c+=	-Dmain=kernmain
 
 CPPFLAGS.thunk.c+=	${USERMODE_CPPFLAGS}

Index: src/sys/arch/usermode/include/thunk.h
diff -u src/sys/arch/usermode/include/thunk.h:1.55 src/sys/arch/usermode/include/thunk.h:1.56
--- src/sys/arch/usermode/include/thunk.h:1.55	Tue Jan  3 12:05:01 2012
+++ src/sys/arch/usermode/include/thunk.h	Thu Jan  5 12:12:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.h,v 1.55 2012/01/03 12:05:01 reinoud Exp $ */
+/* $NetBSD: thunk.h,v 1.56 2012/01/05 12:12:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill 
@@ -61,7 +61,6 @@ struct thunk_termios {
 #define THUNK_MAP_FILE		0x0004
 #define THUNK_MAP_SHARED	0x0010
 #define THUNK_MAP_PRIVATE	0x0020
-#define THUNK_MAP_NOSYSCALLS	0x0040
 
 #define THUNK_PROT_NONE		0x00
 #define THUNK_PROT_READ		0x01
@@ -73,6 +72,8 @@ struct aiocb;
 void	thunk_printf_debug(const char *fmt, ...) __attribute__((__format__(__printf__, 1, 2)));
 void	thunk_printf(const char *fmt, ...) __attribute__((__format__(__printf__, 1, 2)));
 
+int	thunk_syscallemu_init(void *, void *);
+
 int	thunk_setitimer(int, const struct thunk_itimerval *, struct thunk_itimerval *);
 int	thunk_gettimeofday(struct thunk_timeval *, void *);
 unsigned int thunk_getcounter(void);

Index: src/sys/arch/usermode/usermode/pmap.c
diff -u src/sys/arch/usermode/usermode/pmap.c:1.96 src/sys/arch/usermode/usermode/pmap.c:1.97
--- src/sys/arch/usermode/usermode/pmap.c:1.96	Wed Jan  4 16:20:41 2012
+++ src/sys/arch/usermode/usermode/pmap.c	Thu Jan  5 12:12:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.96 2012/01/04 16:20:41 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.97 2012/01/05 12:12:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Reinoud Zandijk 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.96 2012/01/04 16:20:41 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.97 2012/01/05 12:12:58 jmcneill Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -399,6 +399,11 @@ pmap_bootstrap(void)
 	atop(free_end), 
 	VM_FREELIST_DEFAULT);
 
+	/* setup syscall emulation */
+	if (thunk_syscallemu_init((void *)VM_MIN_ADDRESS,
+	(void *)VM_MAXUSER_ADDRESS) != 0)
+		panic("couldn't enable syscall emulation");
+
 	aprint_verbose("leaving pmap_bootstrap:\n");
 	aprint_verbose("\t%"PRIu64" MB of physical pages left\n",
 		(uint64_t) (free_end - (free_start + fpos))/1024/1024);
@@ -735,8 +740,6 @@ pmap_page_activate(struct pv_entry *pv)
 	void *addr;
 
 	map_flags = THUNK_MAP_FILE | THUNK_MAP_FIXED | THUNK_MAP_SHARED;
-	if ((va >= VM_MIN_ADDRESS) && (va < VM_MAXUSER_ADDRESS)) 
-		map_flags |= THUNK_MAP_NOSYSCALLS;
 
 	addr = thunk_mmap((void *) va, PAGE_SIZE, pv->pv_mmap_ppl,
 		map_flags, mem_fh, pa);

Index: src/sys/arch/usermode/usermode/thunk.c
diff -u src/sys/arch/usermode/usermode/thunk.c:1.73 src/sys/arch/usermode/usermode/thunk.c:1.74
--- src/sys/arch/usermode/usermode/thunk.c:1.73	Wed Jan  4 13:31:30 2012
+++ src/sys/arch/usermode/usermode/thunk.c	Thu Jan  5 12:12:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: thunk.c,v 1.73 2012/01/04 13:31:30 reinoud Exp $ */
+/* $NetBSD: thunk.c,v 1.74 2012/01/05 12:12:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 #ifdef __NetBSD__
-__RCSID("$NetBSD: thunk.c,v 1.73 2012/01/04 13:31:30 reinoud Exp $");
+__RCSID("$NetBSD: thunk.c,v 1.74 2012/01/05 12:12:58 jmcneill Exp $");
 #endif
 
 #include 
@@ -69,6 +69,10 @@ __RCSID("$NetBSD: thunk

CVS commit: [netbsd-5] src/sys/dev/pci

2012-01-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan  5 11:54:05 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wmreg.h

Log Message:
Pull up the following revisions(s) (requested by dyoung in ticket #1703):
sys/dev/pci/if_wmreg.h: revision 1.46

Mark all of the wm(4) Rx descriptor fields 'volatile' so that the compiler
will not re-order accesses.  Some versions of GCC (such as one in NetBSD
5.x) definitely do re-order reads from these fields if they're not
marked volatile.


To generate a diff of this commit:
cvs rdiff -u -r1.24.20.5 -r1.24.20.6 src/sys/dev/pci/if_wmreg.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/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.24.20.5 src/sys/dev/pci/if_wmreg.h:1.24.20.6
--- src/sys/dev/pci/if_wmreg.h:1.24.20.5	Fri Nov 19 23:40:28 2010
+++ src/sys/dev/pci/if_wmreg.h	Thu Jan  5 11:54:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.24.20.5 2010/11/19 23:40:28 riz Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.24.20.6 2012/01/05 11:54:05 sborrill Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -57,14 +57,14 @@ typedef struct wiseman_addr {
  * and there must be an even multiple of 8 descriptors in the ring.
  */
 typedef struct wiseman_rxdesc {
-	wiseman_addr_t	wrx_addr;	/* buffer address */
+	volatile wiseman_addr_t	wrx_addr;	/* buffer address */
 
-	uint16_t	wrx_len;	/* buffer length */
-	uint16_t	wrx_cksum;	/* checksum (starting at PCSS) */
+	volatile uint16_t	wrx_len;	/* buffer length */
+	volatile uint16_t	wrx_cksum;	/* checksum (starting at PCSS)*/
 
-	uint8_t		wrx_status;	/* Rx status */
-	uint8_t		wrx_errors;	/* Rx errors */
-	uint16_t	wrx_special;	/* special field (VLAN, etc.) */
+	volatile uint8_t	wrx_status;	/* Rx status */
+	volatile uint8_t	wrx_errors;	/* Rx errors */
+	volatile uint16_t	wrx_special;	/* special field (VLAN, etc.) */
 } __packed wiseman_rxdesc_t;
 
 /* wrx_status bits */



CVS commit: [netbsd-5] src/doc

2012-01-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan  5 11:54:25 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1703


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.125 -r1.1.2.126 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.125 src/doc/CHANGES-5.2:1.1.2.126
--- src/doc/CHANGES-5.2:1.1.2.125	Thu Jan  5 10:36:33 2012
+++ src/doc/CHANGES-5.2	Thu Jan  5 11:54:24 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.125 2012/01/05 10:36:33 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.126 2012/01/05 11:54:24 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5856,3 +5856,11 @@ sys/net/if.c	1.246
 	around. Reverts fix for PR 42585 (ticket #1416) as the root cause
 	of the crash is addressed by PR 44054 (pullup #1541).
 	[obache, ticket #1708]
+
+sys/dev/pci/if_wmreg.h1.46
+	Mark all of the Rx descriptor fields 'volatile' so that the compiler
+	will not re-order accesses.  Some versions of GCC (such as one in NetBSD
+	5.x) definitely do re-order reads from these fields if they're not
+	marked volatile.
+	[dyoung, ticket #1703]
+



CVS commit: [netbsd-5] src/doc

2012-01-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan  5 10:36:33 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Grammar fixes on ticket #1707


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.124 -r1.1.2.125 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.124 src/doc/CHANGES-5.2:1.1.2.125
--- src/doc/CHANGES-5.2:1.1.2.124	Thu Jan  5 09:48:49 2012
+++ src/doc/CHANGES-5.2	Thu Jan  5 10:36:33 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.124 2012/01/05 09:48:49 sborrill Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.125 2012/01/05 10:36:33 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5846,8 +5846,8 @@ xsrc/xfree/xc/programs/Xserver/mi/miarc.
 xsrc/xfree/xc/programs/Xserver/mi/misprite.c	1.2
 
 	mod(a,b) used to be defined with a - in front of naked a, such that
-	uses of mod with certain arithmetic expressions as a led to
-	surprising results, namely the one in Xrender praised in
+	uses of mod with certain arithmetic expressions leads to
+	surprising results, namely the one in Xrender raised in
 	CVE-2010-1166.
 	[is, ticket #1707]
 



CVS commit: [netbsd-5] src/doc

2012-01-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan  5 09:48:49 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket #1708


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.123 -r1.1.2.124 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.123 src/doc/CHANGES-5.2:1.1.2.124
--- src/doc/CHANGES-5.2:1.1.2.123	Mon Jan  2 23:53:07 2012
+++ src/doc/CHANGES-5.2	Thu Jan  5 09:48:49 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.123 2012/01/02 23:53:07 snj Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.124 2012/01/05 09:48:49 sborrill Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -5851,3 +5851,8 @@ xsrc/xfree/xc/programs/Xserver/mi/mispri
 	CVE-2010-1166.
 	[is, ticket #1707]
 
+sys/net/if.c	1.246
+	PR/44030: ifreqn2o gets called with the parameters the wrong way
+	around. Reverts fix for PR 42585 (ticket #1416) as the root cause
+	of the crash is addressed by PR 44054 (pullup #1541).
+	[obache, ticket #1708]



CVS commit: [netbsd-5] src/sys/net

2012-01-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Jan  5 09:47:39 UTC 2012

Modified Files:
src/sys/net [netbsd-5]: if.c

Log Message:
Pull up the following revisions(s) (requested by obache in ticket #1708):
sys/net/if.c:   revision 1.246

PR/44030: ifreqn2o gets called with the parameters the wrong way around.
Reverts fix for PR 42585 (ticket #1416) as the root cause of the crash is
addressed by PR 44054 (pullup #1541).


To generate a diff of this commit:
cvs rdiff -u -r1.230.4.5 -r1.230.4.6 src/sys/net/if.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.230.4.5 src/sys/net/if.c:1.230.4.6
--- src/sys/net/if.c:1.230.4.5	Mon Aug  8 19:33:34 2011
+++ src/sys/net/if.c	Thu Jan  5 09:47:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.230.4.5 2011/08/08 19:33:34 riz Exp $	*/
+/*	$NetBSD: if.c,v 1.230.4.6 2012/01/05 09:47:38 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.230.4.5 2011/08/08 19:33:34 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.230.4.6 2012/01/05 09:47:38 sborrill Exp $");
 
 #include "opt_inet.h"
 
@@ -1715,7 +1715,7 @@ ifioctl(struct socket *so, u_long cmd, v
 	}
 #ifdef COMPAT_OIFREQ
 	if (cmd != ocmd)
-		ifreqn2o(ifr, oifr);
+		ifreqn2o(oifr, ifr);
 #endif
 
 	return error;