CVS commit: src/sys/arch/evbmips/rasoc

2011-08-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 16 06:59:20 UTC 2011

Modified Files:
src/sys/arch/evbmips/rasoc: machdep.c

Log Message:
Use cpu_startup_command (and now HWRENA gets properly initialized).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbmips/rasoc/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/evbmips/rasoc/machdep.c
diff -u src/sys/arch/evbmips/rasoc/machdep.c:1.4 src/sys/arch/evbmips/rasoc/machdep.c:1.5
--- src/sys/arch/evbmips/rasoc/machdep.c:1.4	Wed Aug  3 17:34:27 2011
+++ src/sys/arch/evbmips/rasoc/machdep.c	Tue Aug 16 06:59:19 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.4 2011/08/03 17:34:27 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.5 2011/08/16 06:59:19 matt Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.4 2011/08/03 17:34:27 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2011/08/16 06:59:19 matt Exp $");
 
 #include 
 #include 
@@ -207,41 +207,17 @@
 void
 cpu_startup(void)
 {
-	char pbuf[9];
-	vaddr_t minaddr, maxaddr;
 #ifdef DEBUG
-	extern int pmapdebug;		/* XXX */
-	int opmapdebug = pmapdebug;
-
+	extern int pmapdebug;
+	const int opmapdebug = pmapdebug;
 	pmapdebug = 0;		/* Shut up pmap debug during bootstrap */
 #endif
 
-	/*
-	 * Good {morning,afternoon,evening,night}.
-	 */
-	printf("%s%s", copyright, version);
-	printf("Boot processor: %s\n", cpu_model);
-	format_bytes(pbuf, sizeof(pbuf), physmem << PAGE_SHIFT);
-	printf("total memory = %s\n", pbuf);
-
-	/*
-	 * Allocate a submap for physio
-	 */
-	minaddr = 0;
-	phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-		VM_PHYS_SIZE, 0, FALSE, NULL);
-
-	/*
-	 * No need to allocate an mbuf cluster submap.  Mbuf clusters
-	 * are allocated via the pool allocator, and we use KSEG to
-	 * map those pages.
-	 */
+	cpu_startup_common();
 
 #ifdef DEBUG
 	pmapdebug = opmapdebug;
 #endif
-	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
-	printf("avail memory = %s\n", pbuf);
 }
 
 void



CVS commit: src/sys/arch/mips

2011-08-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 16 06:58:16 UTC 2011

Modified Files:
src/sys/arch/mips/conf: files.mips
src/sys/arch/mips/include: cpu.h mipsNN.h pcb.h reg.h regnum.h trap.h
types.h
src/sys/arch/mips/mips: cpu_subr.c mips_fpu.c mips_machdep.c trap.c
Added Files:
src/sys/arch/mips/mips: mips_dsp.c

Log Message:
Add support for the MIPS DSP ASE (as a second PCU).


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/mips/include/cpu.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/include/mipsNN.h
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/include/pcb.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/include/reg.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mips/include/regnum.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/include/trap.h
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mips/include/types.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/mips/mips/mips_dsp.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/mips/mips_fpu.c
cvs rdiff -u -r1.245 -r1.246 src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.231 -r1.232 src/sys/arch/mips/mips/trap.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/conf/files.mips
diff -u src/sys/arch/mips/conf/files.mips:1.71 src/sys/arch/mips/conf/files.mips:1.72
--- src/sys/arch/mips/conf/files.mips:1.71	Sun Jul 31 15:39:28 2011
+++ src/sys/arch/mips/conf/files.mips	Tue Aug 16 06:58:15 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mips,v 1.71 2011/07/31 15:39:28 matt Exp $
+#	$NetBSD: files.mips,v 1.72 2011/08/16 06:58:15 matt Exp $
 #
 
 defflag	opt_cputype.h		NOFPU FPEMUL
@@ -47,6 +47,7 @@
 file	arch/mips/mips/pmap_tlb.c
 file	arch/mips/mips/trap.c			# trap handlers
 file	arch/mips/mips/syscall.c		# syscall entries
+file	arch/mips/mips/mips_dsp.c		mips32r2 | mips64r2
 file	arch/mips/mips/mips_fixup.c
 file	arch/mips/mips/mips_fpu.c
 file	arch/mips/mips/mips_machdep.c

Index: src/sys/arch/mips/include/cpu.h
diff -u src/sys/arch/mips/include/cpu.h:1.104 src/sys/arch/mips/include/cpu.h:1.105
--- src/sys/arch/mips/include/cpu.h:1.104	Sun Jul 31 15:36:28 2011
+++ src/sys/arch/mips/include/cpu.h	Tue Aug 16 06:58:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.104 2011/07/31 15:36:28 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.105 2011/08/16 06:58:15 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -104,6 +104,8 @@
 	volatile u_int ci_softints;
 	struct evcnt ci_ev_fpu_loads;	/* fpu load counter */
 	struct evcnt ci_ev_fpu_saves;	/* fpu save counter */
+	struct evcnt ci_ev_dsp_loads;	/* dsp load counter */
+	struct evcnt ci_ev_dsp_saves;	/* dsp save counter */
 	struct evcnt ci_ev_tlbmisses;
 
 	/*
@@ -282,6 +284,7 @@
 #define	CPU_MIPS_HAVE_MxCR		0x2000	/* have mfcr, mtcr insns */
 #define	CPU_MIPS_LOONGSON2		0x4000
 #define	MIPS_NOT_SUPP			0x8000
+#define	CPU_MIPS_HAVE_DSP		0x1
 
 #endif	/* !_LOCORE */
 
@@ -300,6 +303,7 @@
 # define MIPS_HAS_CLOCK		0
 # define MIPS_HAS_LLSC		0
 # define MIPS_HAS_LLADDR	0
+# define MIPS_HAS_DSP		0
 
 #elif defined(MIPS3) || defined(MIPS4)
 
@@ -322,6 +326,7 @@
 #  define MIPS_HAS_LLSC		(mips_options.mips_has_llsc)
 # endif	/* _LOCORE */
 # define MIPS_HAS_LLADDR	((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
+# define MIPS_HAS_DSP		0
 
 #elif defined(MIPS32)
 
@@ -336,6 +341,7 @@
 # define MIPS_HAS_CLOCK		1
 # define MIPS_HAS_LLSC		1
 # define MIPS_HAS_LLADDR	((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
+# define MIPS_HAS_DSP		0
 
 #elif defined(MIPS32R2)
 
@@ -350,6 +356,7 @@
 # define MIPS_HAS_CLOCK		1
 # define MIPS_HAS_LLSC		1
 # define MIPS_HAS_LLADDR	((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
+# define MIPS_HAS_DSP		(mips_options.mips_cpu_flags & CPU_MIPS_HAVE_DSP)
 
 #elif defined(MIPS64)
 
@@ -364,6 +371,7 @@
 # define MIPS_HAS_CLOCK		1
 # define MIPS_HAS_LLSC		1
 # define MIPS_HAS_LLADDR	((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
+# define MIPS_HAS_DSP		0
 
 #elif defined(MIPS64R2)
 
@@ -378,6 +386,7 @@
 # define MIPS_HAS_CLOCK		1
 # define MIPS_HAS_LLSC		1
 # define MIPS_HAS_LLADDR	((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
+# define MIPS_HAS_DSP		(mips_options.mips_cpu_flags & CPU_MIPS_HAVE_DSP)
 
 #endif
 
@@ -388,6 +397,7 @@
 #define	MIPS_HAS_R4K_MMU	(mips_options.mips_has_r4k_mmu)
 #define	MIPS_HAS_LLSC		(mips_options.mips_has_llsc)
 #define	MIPS_HAS_LLADDR		((mips_options.mips_cpu_flags & CPU_MIPS_NO_LLADDR) == 0)
+# define MIPS_HAS_DSP		(mips_options.mips_cpu_flags & CPU_MIPS_HAVE_DSP)
 
 /* This test is ... rather bogus */
 #define	CPUISMIPS3	((mips_options.mips_cpu_arch & \
@@ -621,12 +631,21 @@
 void	netintr(void);
 int	kdbpeek(vaddr_t);
 
+/* mips_dsp.c */
+void	dsp_init(void);
+void	dsp_discard(void);
+void	dsp_load(void);
+void	dsp_save(void);
+bool	dsp_used_p

CVS commit: src/sys/arch/mips/mips

2011-08-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Aug 16 06:55:12 UTC 2011

Modified Files:
src/sys/arch/mips/mips: bds_emul.S copy.S fp.S locore.S locore_mips3.S
mipsX_subr.S

Log Message:
Only jump through t9/ra (or k0) to help avoid hitting
the Loongson2 jump problem.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/mips/bds_emul.S
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/mips/copy.S
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/mips/mips/fp.S
cvs rdiff -u -r1.187 -r1.188 src/sys/arch/mips/mips/locore.S
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/mips/mips/locore_mips3.S
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mips/mips/mipsX_subr.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/bds_emul.S
diff -u src/sys/arch/mips/mips/bds_emul.S:1.4 src/sys/arch/mips/mips/bds_emul.S:1.5
--- src/sys/arch/mips/mips/bds_emul.S:1.4	Sat Feb 26 11:27:59 2011
+++ src/sys/arch/mips/mips/bds_emul.S	Tue Aug 16 06:55:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bds_emul.S,v 1.4 2011/02/26 11:27:59 tsutsui Exp $	*/
+/*	$NetBSD: bds_emul.S,v 1.5 2011/08/16 06:55:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -66,8 +66,8 @@
 
 	srl	t0, a0, 26-PTR_SCALESHIFT
 	andi	t0, 0x3F << PTR_SCALESHIFT
-	PTR_L	t0, bcemul_optbl(t0)
-	j	t0
+	PTR_L	t9, bcemul_optbl(t0)
+	jr	t9
 
 	.rdata
 bcemul_optbl:
@@ -173,7 +173,7 @@
 	REG_PROLOGUE
 	REG_L	v0, TF_REG_ZERO(t1)		# load source
 	REG_EPILOGUE
-	j	ra# execute the instruction
+	jr	ra# execute the instruction
 
 bcemul_uimmed_prologue:
 	srl	t1, a0, 21-REG_SCALESHIFT	# rs (source)
@@ -186,7 +186,7 @@
 	REG_PROLOGUE
 	REG_L	v0, TF_REG_ZERO(t1)		# load source
 	REG_EPILOGUE
-	j	ra
+	jr	ra
 
 #ifndef __mips_o32
 bcemul_daddi:
@@ -441,11 +441,12 @@
 	andi	t0, a0, 0x3f			# get special code
 	sll	t1, t0, 3			# calculate index in specialop
 	sll	t0, PTR_SCALESHIFT
-	PTR_LA	t9, bcemul_special_op(t1)
-	PTR_L	t0, bcemul_specialtbl(t0)
-	j	t0
+	PTR_LA	t0, bcemul_special_op(t1)
+	PTR_L	t9, bcemul_specialtbl(t0)
+	jr	t9
 
 bcemul_special_3op_prologue:
+	move	t9, t0
 	srl	t0, a0, 21-REG_SCALESHIFT	# rs (source1)
 	srl	t1, a0, 16-REG_SCALESHIFT	# rt (source2)
 	srl	t2, a0, 11-REG_SCALESHIFT	# rd (dest)
@@ -459,9 +460,10 @@
 	REG_L	v0, TF_REG_ZERO(t0)		# load source1
 	REG_L	v1, TF_REG_ZERO(t1)		# load source2
 	REG_EPILOGUE
-	j	t9
+	jr	t9
 
 bcemul_special_2src_prologue:
+	move	t9, t0
 	srl	t0, a0, 21-REG_SCALESHIFT	# rs (source1)
 	srl	t1, a0, 16-REG_SCALESHIFT	# rt (source2)
 	andi	t0, REG_REGMASK
@@ -472,9 +474,10 @@
 	REG_L	v0, TF_REG_ZERO(t0)		# load source1
 	REG_L	v1, TF_REG_ZERO(t1)		# load source2
 	REG_EPILOGUE
-	j	t9
+	jr	t9
 
 bcemul_special_genshift:
+	move	t9, t0
 	srl	t1, a0, 16-REG_SCALESHIFT	# rt (source)
 	srl	t2, a0, 11-REG_SCALESHIFT	# rd (dest)
 	srl	v1, a0, 6			# sa
@@ -606,7 +609,7 @@
 	REG_L	ra, CALLFRAME_RA(sp)
 	REG_L	s0, CALLFRAME_S0(sp)
 	PTR_ADDU sp, CALLFRAME_SIZ
-	j	ra
+	jr	ra
 
 /*
  * Send SIGILL, SIGFPE.

Index: src/sys/arch/mips/mips/copy.S
diff -u src/sys/arch/mips/mips/copy.S:1.14 src/sys/arch/mips/mips/copy.S:1.15
--- src/sys/arch/mips/mips/copy.S:1.14	Wed Jul  6 09:27:35 2011
+++ src/sys/arch/mips/mips/copy.S	Tue Aug 16 06:55:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.14 2011/07/06 09:27:35 matt Exp $	*/
+/*	$NetBSD: copy.S,v 1.15 2011/08/16 06:55:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -499,9 +499,9 @@
 	 PTR_S	v0, PCB_ONFAULT(v1)
 	INT_S	a1, 0(a0)			# store word
 	PTR_S	zero, PCB_ONFAULT(v1)
-	PTR_L	v1, _C_LABEL(mips_cache_ops) + MIPSX_FLUSHICACHE
+	PTR_L	t9, _C_LABEL(mips_cache_ops) + MIPSX_FLUSHICACHE
 	move	v0, zero
-	j	v1# NOTE: must not clobber v0!
+	j	t9# NOTE: must not clobber v0!
 	 li	a1, 4# size of word
 END(ustore_uint32_isync)
 

Index: src/sys/arch/mips/mips/fp.S
diff -u src/sys/arch/mips/mips/fp.S:1.43 src/sys/arch/mips/mips/fp.S:1.44
--- src/sys/arch/mips/mips/fp.S:1.43	Sat Feb 26 15:41:32 2011
+++ src/sys/arch/mips/mips/fp.S	Tue Aug 16 06:55:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fp.S,v 1.43 2011/02/26 15:41:32 tsutsui Exp $	*/
+/*	$NetBSD: fp.S,v 1.44 2011/08/16 06:55:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -151,29 +151,29 @@
 single_op:
 	andi	v0, a0, 0x3F		# get FUNC field
 	sll	v0, v0, PTR_SCALESHIFT
-	PTR_L	v0, func_single_tbl(v0)
-	j	v0
+	PTR_L	t9, func_single_tbl(v0)
+	j	t9
 double_op:
 	andi	v0, a0, 0x3F		# get FUNC field
 	sll	v0, v0, PTR_SCALESHIFT
-	PTR_L	v0, func_double_tbl(v0)
-	j	v0
+	PTR_L	t9, func_double_tbl(v0)
+	j	t9
 single_fixed_op:
 	andi	v0, a0, 0x3F		# get FUNC field
 	sll	v0, v0, PTR_SCALESHIFT
-	PTR_L	v0, func_single_fixed_tbl(v0)
-	j	v0
+	PTR_L	t9, func_single_fixed_tbl(v0)
+	j	t9
 long_fixed_op:
 	andi	v0, a0, 0x3F		# get FUNC field
 	sll	v0, v0, PTR_SCALESHIFT
-	PTR_L	v0, func_long_fixed_tbl(v0)
-	j	v0
+	PTR_L	t9, func_long_fixed_tbl(v0)
+	j	t9
 #if (defined(__mips_n32) || defined(__mips_n64)) && 0
 paired_sin

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

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 05:28:44 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.c
src/external/bsd/ntp/dist/sntp: log.c

Log Message:
- proper varyadic warning and error
- don't call syslog with a buffer, use %s first.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpq/ntpq.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/sntp/log.c

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

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.2 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.3
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.2	Sat Dec  4 18:08:35 2010
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Tue Aug 16 01:28:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.2 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.3 2011/08/16 05:28:44 christos Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -291,8 +291,10 @@
 static	void	cooked		(struct parse *, FILE *);
 static	void	authenticate	(struct parse *, FILE *);
 static	void	ntpversion	(struct parse *, FILE *);
-static	void	warning		(const char *, const char *, const char *);
-static	void	error		(const char *, const char *, const char *);
+static	void	warning		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
+static	void	error		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
 static	u_long	getkeyid	(const char *);
 static	void	atoascii	(const char *, size_t, char *, size_t);
 static	void	makeascii	(int, char *, FILE *);
@@ -757,7 +759,7 @@
 
 	sockfd = socket(ai->ai_family, SOCK_DGRAM, 0);
 	if (sockfd == INVALID_SOCKET) {
-		error("socket", "", "");
+		error("socket");
 	}
 
 	
@@ -766,7 +768,7 @@
 	{ int rbufsize = DATASIZE + 2048;	/* 2K for slop */
 	if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
 		   &rbufsize, sizeof(int)) == -1)
-	error("setsockopt", "", "");
+	error("setsockopt");
 	}
 # endif
 #endif
@@ -778,7 +780,7 @@
 	if (connect(sockfd, (struct sockaddr *)ai->ai_addr,
 		ai->ai_addrlen) == -1)
 #endif /* SYS_VXWORKS */
-	error("connect", "", "");
+	error("connect");
 	if (a_info == 0)
 		freeaddrinfo(ai);
 	havehost = 1;
@@ -800,7 +802,7 @@
 		printf("Sending %zu octets\n", xdatalen);
 
 	if (send(sockfd, xdata, (size_t)xdatalen, 0) == -1) {
-		warning("write to %s failed", currenthost, "");
+		warning("write to %s failed", currenthost);
 		return -1;
 	}
 
@@ -880,7 +882,7 @@
 		n = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvo);
 
 		if (n == -1) {
-			warning("select fails", "", "");
+			warning("select fails");
 			return -1;
 		}
 		if (n == 0) {
@@ -914,7 +916,7 @@
 
 		n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0);
 		if (n == -1) {
-			warning("read", "", "");
+			warning("read");
 			return -1;
 		}
 
@@ -2616,37 +2618,46 @@
 }
 
 
+static void __attribute__((__format__(__printf__, 1, 0)))
+vwarning(const char *fmt, va_list ap)
+{
+	int serrno = errno;
+	(void) fprintf(stderr, "%s: ", progname);
+	vfprintf(stderr, fmt, ap);
+	(void) fprintf(stderr, ": %s", strerror(serrno));
+}
+
 /*
  * warning - print a warning message
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 warning(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	(void) fprintf(stderr, "%s: ", progname);
-	(void) fprintf(stderr, fmt, st1, st2);
-	(void) fprintf(stderr, ": ");
-	perror("");
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 }
 
 
 /*
  * error - print a message and exit
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 error(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	warning(fmt, st1, st2);
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 	exit(1);
 }
-
 /*
  * getkeyid - prompt the user for a keyid to use
  */

Index: src/external/bsd/ntp/dist/sntp/log.c
diff -u src/external/bsd/ntp/dist/sntp/log.c:1.2 src/external/bsd/ntp/dist/sntp/log.c:1.3
--- src/external/bsd/ntp/dist/sntp/log.c:1.2	Sat Dec  4 18:08:36 2010
+++ src/external/bsd/ntp/dist/sntp/log.c	Tue Aug 16 01:28:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.2 2010/12/04 23:08:36 christos Exp $	*/
+/*	$NetBSD: log.c,v 1.3 2011/08/16 05:28:44 christos Exp $	*/
 
 #include "log.h"
 #include "sntp-opts.h"
@@ -32,7 +32,7 @@
 break;
 		}
 
-		syslog(type, message);
+		syslog(type, "%s", message);
 	}
 }
 
@@ -48,7 +48,7 @@
 #ifdef LOG_PERROR
 			| LOG_PERROR
 #endif
-			| LOG_CONS, message);
+			| LOG_CONS, "%s", message);
 	}
 }
 



CVS commit: src/external/bsd/ntp/dist/ntpdc

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 05:24:20 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/ntpdc: ntpdc.c

Log Message:
- it is not the 80's anymore, use proper varargs
- no need to exit again, error does


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpdc/ntpdc.c

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

Modified files:

Index: src/external/bsd/ntp/dist/ntpdc/ntpdc.c
diff -u src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.2 src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.3
--- src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.2	Sat Dec  4 18:08:35 2010
+++ src/external/bsd/ntp/dist/ntpdc/ntpdc.c	Tue Aug 16 01:24:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpdc.c,v 1.2 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntpdc.c,v 1.3 2011/08/16 05:24:20 christos Exp $	*/
 
 /*
  * ntpdc - control and monitor your ntpd daemon
@@ -102,8 +102,10 @@
 static	void	setdebug	(struct parse *, FILE *);
 static	void	quit		(struct parse *, FILE *);
 static	void	version		(struct parse *, FILE *);
-static	void	warning		(const char *, const char *, const char *);
-static	void	error		(const char *, const char *, const char *);
+static	void	warning		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
+static	void	error		(const char *, ...)
+__attribute__((__format__(__printf__, 1, 2)));
 static	u_long	getkeyid	(const char *);
 
 
@@ -571,14 +573,12 @@
 	}
 
 	sockfd = socket(ai->ai_family, SOCK_DGRAM, 0);
-	if (sockfd == INVALID_SOCKET) {
-		error("socket", "", "");
-		exit(-1);
-	}
+	if (sockfd == INVALID_SOCKET)
+		error("socket");
 #else
 	sockfd = socket(ai->ai_family, SOCK_DGRAM, 0);
 	if (sockfd == -1)
-	error("socket", "", "");
+	error("socket");
 #endif /* SYS_WINNT */
 
 	
@@ -589,7 +589,7 @@
 
 		if (setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF,
 			   &rbufsize, sizeof(int)) == -1)
-		error("setsockopt", "", "");
+		error("setsockopt");
 	}
 # endif
 #endif
@@ -601,7 +601,7 @@
 	if (connect(sockfd, (struct sockaddr *)ai->ai_addr,
 		ai->ai_addrlen) == -1)
 #endif /* SYS_VXWORKS */
-	error("connect", "", "");
+	error("connect");
 
 	freeaddrinfo(ai);
 	havehost = 1;
@@ -622,7 +622,7 @@
 	)
 {
 	if (send(sockfd, xdata, xdatalen, 0) == -1) {
-		warning("write to %s failed", currenthost, "");
+		warning("write to %s failed", currenthost);
 		return -1;
 	}
 
@@ -697,7 +697,7 @@
 	n = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvo);
 
 	if (n == -1) {
-		warning("select fails", "", "");
+		warning("select fails");
 		return -1;
 	}
 	if (n == 0) {
@@ -728,7 +728,7 @@
 
 	n = recv(sockfd, (char *)&rpkt, sizeof(rpkt), 0);
 	if (n == -1) {
-		warning("read", "", "");
+		warning("read");
 		return -1;
 	}
 
@@ -1046,7 +1046,7 @@
 		res = select(sockfd+1, &fds, (fd_set *)0, (fd_set *)0, &tvzero);
 
 		if (res == -1) {
-			warning("polling select", "", "");
+			warning("polling select");
 			return -1;
 		} else if (res > 0)
 
@@ -1951,34 +1951,44 @@
 }
 
 
+static void __attribute__((__format__(__printf__, 1, 0)))
+vwarning(const char *fmt, va_list ap)
+{
+	int serrno = errno;
+	(void) fprintf(stderr, "%s: ", progname);
+	vfprintf(stderr, fmt, ap);
+	(void) fprintf(stderr, ": %s", strerror(serrno));
+}
+
 /*
  * warning - print a warning message
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 warning(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	(void) fprintf(stderr, "%s: ", progname);
-	(void) fprintf(stderr, fmt, st1, st2);
-	(void) fprintf(stderr, ": ");
-	perror("");
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 }
 
 
 /*
  * error - print a message and exit
  */
-static void
+static void __attribute__((__format__(__printf__, 1, 2)))
 error(
 	const char *fmt,
-	const char *st1,
-	const char *st2
+	...
 	)
 {
-	warning(fmt, st1, st2);
+	va_list ap;
+	va_start(ap, fmt);
+	vwarning(fmt, ap);
+	va_end(ap);
 	exit(1);
 }
 



CVS commit: src/external/bsd/ntp

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 05:15:21 UTC 2011

Modified Files:
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/dist/include: ntp_request.h
src/external/bsd/ntp/dist/ntpd: ntp_config.c ntp_control.c
ntp_request.c ntpd.c refclock_jupiter.c refclock_oncore.c

Log Message:
- document non-literal strings
- fix bad security practices: {msyslog,syslog,printf}(buffer) ->
{msyslog,syslog,printf}("%s", buffer)
- use an anonymous union to avoid type punning casts
- re-order expression to avoid integer overflow


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/include/ntp_request.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/ntp_config.c \
src/external/bsd/ntp/dist/ntpd/ntp_control.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/ntp_request.c \
src/external/bsd/ntp/dist/ntpd/ntpd.c \
src/external/bsd/ntp/dist/ntpd/refclock_oncore.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/ntpd/refclock_jupiter.c

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

Modified files:

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.9 src/external/bsd/ntp/bin/ntpd/Makefile:1.10
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.9	Tue Jun 21 22:49:42 2011
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Tue Aug 16 01:15:20 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2011/06/22 02:49:42 mrg Exp $
+#	$NetBSD: Makefile,v 1.10 2011/08/16 05:15:20 christos Exp $
 
 #NOGCCERROR=yes
 
@@ -90,13 +90,10 @@
 	${TOOL_SED} -e "s,NTPD 1,NTPD 8," $? > $@
 
 CLEANFILES+=ntpd.8
+COPTS.ntp_control.c+= -Wno-format-nonliteral
 
 .include 
 
 # kill default .y.c rule - to rebuild ntp_parser.c we need bison which is not part of the toolchain
 .y.c:
 
-# XXX
-.if ${HAVE_GCC} == 45
-COPTS.ntp_request.c+= -Wno-error -fno-strict-aliasing
-.endif

Index: src/external/bsd/ntp/dist/include/ntp_request.h
diff -u src/external/bsd/ntp/dist/include/ntp_request.h:1.1.1.1 src/external/bsd/ntp/dist/include/ntp_request.h:1.2
--- src/external/bsd/ntp/dist/include/ntp_request.h:1.1.1.1	Sun Dec 13 11:54:53 2009
+++ src/external/bsd/ntp/dist/include/ntp_request.h	Tue Aug 16 01:15:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.h,v 1.1.1.1 2009/12/13 16:54:53 kardel Exp $	*/
+/*	$NetBSD: ntp_request.h,v 1.2 2011/08/16 05:15:20 christos Exp $	*/
 
 /*
  * ntp_request.h - definitions for the ntpd remote query facility
@@ -125,6 +125,44 @@
 };
 
 /*
+ * Structure for carrying system flags.
+ */
+struct conf_sys_flags {
+	u_int32 flags;
+};
+
+/*
+ * System flags we can set/clear
+ */
+#define	SYS_FLAG_BCLIENT	0x01
+#define	SYS_FLAG_PPS		0x02
+#define SYS_FLAG_NTP		0x04
+#define SYS_FLAG_KERNEL		0x08
+#define SYS_FLAG_MONITOR	0x10
+#define SYS_FLAG_FILEGEN	0x20
+#define SYS_FLAG_AUTH		0x40
+#define SYS_FLAG_CAL		0x80
+
+/*
+ * Structure used for passing indication of flags to clear
+ */
+struct reset_flags {
+	u_int32 flags;
+};
+
+#define	RESET_FLAG_ALLPEERS	0x01
+#define	RESET_FLAG_IO		0x02
+#define	RESET_FLAG_SYS		0x04
+#define	RESET_FLAG_MEM		0x08
+#define	RESET_FLAG_TIMER	0x10
+#define	RESET_FLAG_AUTH		0x20
+#define	RESET_FLAG_CTL		0x40
+
+#define	RESET_ALLFLAGS \
+	(RESET_FLAG_ALLPEERS|RESET_FLAG_IO|RESET_FLAG_SYS \
+	|RESET_FLAG_MEM|RESET_FLAG_TIMER|RESET_FLAG_AUTH|RESET_FLAG_CTL)
+
+/*
  * A request packet.  These are almost a fixed length.
  */
 struct req_pkt {
@@ -134,8 +172,12 @@
 	u_char request;			/* request number */
 	u_short err_nitems;		/* error code/number of data items */
 	u_short mbz_itemsize;		/* item size */
-	char data[MAXFILENAME + 48];	/* data area [32 prev](176 byte max) */
-	/* struct conf_peer must fit */
+	union {
+	char data[MAXFILENAME + 48];/* data area [32 prev](176 byte max) */
+	struct conf_sys_flags c_s_flags;
+	struct reset_flags r_flags;
+	u_int32_t ui;
+	};
 	l_fp tstamp;			/* time stamp, for authentication */
 	keyid_t keyid;			/* (optional) encryption key */
 	char mac[MAX_MAC_LEN-sizeof(keyid_t)]; /* (optional) auth code */
@@ -217,8 +259,8 @@
 
 #define	INFO_ERR(err_nitems)	((u_short)((ntohs(err_nitems)>>12)&0xf))
 #define	INFO_NITEMS(err_nitems)	((u_short)(ntohs(err_nitems)&0xfff))
-#define	ERR_NITEMS(err, nitems)	(htons((u_short)u_short)(err)<<12)&0xf000)\
-|((u_short)(nitems)&0xfff
+#define _ERR_EN(err)		((u_short)(((err)&0xf)<<12))
+#define	ERR_NITEMS(err, nitems)	((u_short)htons(_ERR_EN(err)|(nitems&0xfff)))
 
 #define	INFO_MBZ(mbz_itemsize)	((ntohs(mbz_itemsize)>>12)&0xf)
 #define	INFO_ITEMSIZE(mbz_itemsize)	((u_short)(ntohs(mbz_itemsize)&0xfff))
@@ -618,25 +660,6 @@
 };
 
 /*
- * Structure for carrying system flags.
- */
-struct conf_sys_flags {
-	u_int32 flags;
-};
-
-/*
- * System flags we can set/clear
- */
-#define	SYS_FLAG_BCLIENT	0x01
-#define	SYS_FLAG_PP

CVS commit: src/external/bsd/ntp

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 04:45:17 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/lib/isc: log.c netaddr.c sockaddr.c
src/external/bsd/ntp/dist/lib/isc/unix: ifiter_getifaddrs.c socket.c
src/external/bsd/ntp/lib/libopts: Makefile

Log Message:
- fixes for non-literal strings
- add missing strbuf initialization


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/lib/isc/log.c \
src/external/bsd/ntp/dist/lib/isc/netaddr.c \
src/external/bsd/ntp/dist/lib/isc/sockaddr.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c \
src/external/bsd/ntp/dist/lib/isc/unix/socket.c
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/lib/libopts/Makefile

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

Modified files:

Index: src/external/bsd/ntp/dist/lib/isc/log.c
diff -u src/external/bsd/ntp/dist/lib/isc/log.c:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/log.c:1.2
--- src/external/bsd/ntp/dist/lib/isc/log.c:1.1.1.1	Sun Dec 13 11:54:22 2009
+++ src/external/bsd/ntp/dist/lib/isc/log.c	Tue Aug 16 00:45:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: log.c,v 1.1.1.1 2009/12/13 16:54:22 kardel Exp $	*/
+/*	$NetBSD: log.c,v 1.2 2011/08/16 04:45:17 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
@@ -1520,10 +1520,11 @@
 		level_string[0] == '\0') {
 			if (level < ISC_LOG_CRITICAL)
 snprintf(level_string, sizeof(level_string),
+	 "%s %d: ",
 	 isc_msgcat_get(isc_msgcat,
 			ISC_MSGSET_LOG,
 			ISC_MSG_LEVEL,
-			"level %d: "),
+			"level"),
 	 level);
 			else if (level > ISC_LOG_DYNAMIC)
 snprintf(level_string, sizeof(level_string),
Index: src/external/bsd/ntp/dist/lib/isc/netaddr.c
diff -u src/external/bsd/ntp/dist/lib/isc/netaddr.c:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/netaddr.c:1.2
--- src/external/bsd/ntp/dist/lib/isc/netaddr.c:1.1.1.1	Sun Dec 13 11:54:13 2009
+++ src/external/bsd/ntp/dist/lib/isc/netaddr.c	Tue Aug 16 00:45:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: netaddr.c,v 1.1.1.1 2009/12/13 16:54:13 kardel Exp $	*/
+/*	$NetBSD: netaddr.c,v 1.2 2011/08/16 04:45:17 christos Exp $	*/
 
 /*
  * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
@@ -202,9 +202,10 @@
 
 	if (result != ISC_R_SUCCESS) {
 		snprintf(array, size,
+			 "<%s %u>",
 			 isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR,
 	ISC_MSG_UNKNOWNADDR,
-	""),
+	"unknown address, family"),
 			 na->family);
 		array[size - 1] = '\0';
 	}
Index: src/external/bsd/ntp/dist/lib/isc/sockaddr.c
diff -u src/external/bsd/ntp/dist/lib/isc/sockaddr.c:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/sockaddr.c:1.2
--- src/external/bsd/ntp/dist/lib/isc/sockaddr.c:1.1.1.1	Sun Dec 13 11:54:14 2009
+++ src/external/bsd/ntp/dist/lib/isc/sockaddr.c	Tue Aug 16 00:45:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sockaddr.c,v 1.1.1.1 2009/12/13 16:54:14 kardel Exp $	*/
+/*	$NetBSD: sockaddr.c,v 1.2 2011/08/16 04:45:17 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
@@ -191,9 +191,10 @@
 		 * The message is the same as in netaddr.c.
 		 */
 		snprintf(array, size,
+			 "<%s %u>",
 			 isc_msgcat_get(isc_msgcat, ISC_MSGSET_NETADDR,
 	ISC_MSG_UNKNOWNADDR,
-	""),
+	"unknown address, family"),
 			 sa->type.sa.sa_family);
 		array[size - 1] = '\0';
 	}
@@ -229,10 +230,11 @@
 		break;
 	default:
 		UNEXPECTED_ERROR(__FILE__, __LINE__,
+ "%s: %d",
  isc_msgcat_get(isc_msgcat,
 		ISC_MSGSET_SOCKADDR,
 		ISC_MSG_UNKNOWNFAMILY,
-		"unknown address family: %d"),
+		"unknown address family"),
 	 (int)sockaddr->type.sa.sa_family);
 		s = (const unsigned char *)&sockaddr->type;
 		length = sockaddr->length;
@@ -409,9 +411,10 @@
 		break;
 	default:
 		FATAL_ERROR(__FILE__, __LINE__,
+			"%s: %d",
 			isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
 	   ISC_MSG_UNKNOWNFAMILY,
-	   "unknown address family: %d"),
+	   "unknown address family"),
 			(int)sockaddr->type.sa.sa_family);
 	}
 }
@@ -429,9 +432,10 @@
 		break;
 	default:
 		FATAL_ERROR(__FILE__, __LINE__,
+			"%s: %d",
 			isc_msgcat_get(isc_msgcat, ISC_MSGSET_SOCKADDR,
 	   ISC_MSG_UNKNOWNFAMILY,
-	   "unknown address family: %d"),
+	   "unknown address family"),
 			(int)sockaddr->type.sa.sa_family);
 	}
 

Index: src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c
diff -u src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c:1.2
--- src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c:1.1.1.1	Sun Dec 13 11:54:32 2009
+++ src/external/bsd/ntp/dist/lib/isc/unix/ifiter_getifaddrs.c	Tue Aug 16 00:45:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifiter_getifaddrs.c,v 1.1.1.1 2009/12/13 16:54:32 kardel Exp $	*/
+

CVS commit: src/doc

2011-08-15 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Tue Aug 16 04:04:57 UTC 2011

Modified Files:
src/doc: NetBSD-6

Log Message:
Sync w/ reality

+ gcc 4.5 is done
+ better description of status of iSCSI initiator


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/doc/NetBSD-6

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

Modified files:

Index: src/doc/NetBSD-6
diff -u src/doc/NetBSD-6:1.7 src/doc/NetBSD-6:1.8
--- src/doc/NetBSD-6:1.7	Tue Mar 29 18:07:14 2011
+++ src/doc/NetBSD-6	Tue Aug 16 04:04:57 2011
@@ -7,7 +7,7 @@
 Will be in 6.0
 --
 + ZFS - need an update on viability, needs work
-+ in-kernel iSCSI initiator, and user tools - libisns done, kernel portion near
++ in-kernel iSCSI initiator, and user tools - in othersrc, needs to be moved to src
 + 64-bit time_t
 + rump - pooka has declared interfaces stable
 + LVM/dmapper and tools
@@ -31,11 +31,12 @@
 + automated test framework for testing releng autobuilds
 + full functionality for NPF - SMP-aware packet filter - rmind
 + fixed IPSEC NAT-T
-+ GPT-aware bootloader for i386/amd64
++ GPT-aware bootloader for i386/amd64 - jakllsch
++ gcc 4.5
++ clang - joerg
 
 Possibly in 6.0
 ---
-+ gcc 4.5+
 + mobile IPv6 - we have the mods, need application of same to the repo
 + kernel modules need work
 + Xen suspend/resume - jym working on it
@@ -54,4 +55,4 @@
 
 Alistair Crooks
 On behalf of core and releng teams
-Fri Mar 25 17:20:36 PDT 2011
+Mon Aug 15 07:41:56 PDT 2011



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

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 03:33:37 UTC 2011

Modified Files:
src/external/bsd/libarchive/dist/libarchive:
archive_read_support_compression_compress.c

Log Message:
provisional fix for CVS-2011-2895, buffer overflow during decompress


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \

src/external/bsd/libarchive/dist/libarchive/archive_read_support_compression_compress.c

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

Modified files:

Index: src/external/bsd/libarchive/dist/libarchive/archive_read_support_compression_compress.c
diff -u src/external/bsd/libarchive/dist/libarchive/archive_read_support_compression_compress.c:1.1.1.2 src/external/bsd/libarchive/dist/libarchive/archive_read_support_compression_compress.c:1.2
--- src/external/bsd/libarchive/dist/libarchive/archive_read_support_compression_compress.c:1.1.1.2	Fri Feb 19 21:48:30 2010
+++ src/external/bsd/libarchive/dist/libarchive/archive_read_support_compression_compress.c	Mon Aug 15 23:33:37 2011
@@ -362,6 +362,7 @@
 	}
 
 	if (code > state->free_ent) {
+out:
 		/* An invalid code is a fatal error. */
 		archive_set_error(&(self->archive->archive), -1,
 		"Invalid compressed data");
@@ -376,6 +377,11 @@
 
 	/* Generate output characters in reverse order. */
 	while (code >= 256) {
+		// XXX: long -> ptrdiff_t, but don't want to bother with
+		// autoconf for now.
+		if (state->stackp - state->stack >=
+		(long)(sizeof(state->stack) - 1))
+			goto out;
 		*state->stackp++ = state->suffix[code];
 		code = state->prefix[code];
 	}



CVS commit: src/usr.bin/gzip

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 03:25:35 UTC 2011

Modified Files:
src/usr.bin/gzip: zuncompress.c

Log Message:
set errno on overflow return.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/gzip/zuncompress.c

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

Modified files:

Index: src/usr.bin/gzip/zuncompress.c
diff -u src/usr.bin/gzip/zuncompress.c:1.9 src/usr.bin/gzip/zuncompress.c:1.10
--- src/usr.bin/gzip/zuncompress.c:1.9	Mon Aug 15 23:21:47 2011
+++ src/usr.bin/gzip/zuncompress.c	Mon Aug 15 23:25:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zuncompress.c,v 1.9 2011/08/16 03:21:47 christos Exp $ */
+/*	$NetBSD: zuncompress.c,v 1.10 2011/08/16 03:25:34 christos Exp $ */
 
 /*-
  * Copyright (c) 1985, 1986, 1992, 1993
@@ -288,8 +288,10 @@
 
 		/* Generate output characters in reverse order. */
 		while (zs->u.r.zs_code >= 256) {
-			if (zs->u.r.zs_stackp - de_stack >= HSIZE - 1)
+			if (zs->u.r.zs_stackp - de_stack >= HSIZE - 1) {
+errno = EOVERFLOW;
 return -1;
+			}
 			*zs->u.r.zs_stackp++ = tab_suffixof(zs->u.r.zs_code);
 			zs->u.r.zs_code = tab_prefixof(zs->u.r.zs_code);
 		}



CVS commit: src/usr.bin/compress

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 03:24:47 UTC 2011

Modified Files:
src/usr.bin/compress: zopen.c

Log Message:
provisional fix for CVE-2011-2895, buffer overflow in decompression


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/compress/zopen.c

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

Modified files:

Index: src/usr.bin/compress/zopen.c
diff -u src/usr.bin/compress/zopen.c:1.13 src/usr.bin/compress/zopen.c:1.14
--- src/usr.bin/compress/zopen.c:1.13	Sat Apr 11 08:24:37 2009
+++ src/usr.bin/compress/zopen.c	Mon Aug 15 23:24:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zopen.c,v 1.13 2009/04/11 12:24:37 lukem Exp $	*/
+/*	$NetBSD: zopen.c,v 1.14 2011/08/16 03:24:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1985, 1986, 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)zopen.c	8.1 (Berkeley) 6/27/93";
 #else
-static char rcsid[] = "$NetBSD: zopen.c,v 1.13 2009/04/11 12:24:37 lukem Exp $";
+static char rcsid[] = "$NetBSD: zopen.c,v 1.14 2011/08/16 03:24:47 christos Exp $";
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -519,7 +519,7 @@
 		}
 		incode = code;
 
-		/* Special case for KwKwK string. */
+		/* Special case FOR kWkWk string. */
 		if (code >= free_ent) {
 			*stackp++ = finchar;
 			code = oldcode;
@@ -527,6 +527,10 @@
 
 		/* Generate output characters in reverse order. */
 		while (code >= 256) {
+			if (stackp - de_stack >= HSIZE - 1) {
+errno = EOVERFLOW;
+return -1;
+			}
 			*stackp++ = tab_suffixof(code);
 			code = tab_prefixof(code);
 		}



CVS commit: src/usr.bin/gzip

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 03:21:47 UTC 2011

Modified Files:
src/usr.bin/gzip: zuncompress.c

Log Message:
provisional fix for CVS-2011-2895, buffer overflow when uncompressing


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/gzip/zuncompress.c

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

Modified files:

Index: src/usr.bin/gzip/zuncompress.c
diff -u src/usr.bin/gzip/zuncompress.c:1.8 src/usr.bin/gzip/zuncompress.c:1.9
--- src/usr.bin/gzip/zuncompress.c:1.8	Sat Nov  6 17:42:32 2010
+++ src/usr.bin/gzip/zuncompress.c	Mon Aug 15 23:21:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zuncompress.c,v 1.8 2010/11/06 21:42:32 mrg Exp $ */
+/*	$NetBSD: zuncompress.c,v 1.9 2011/08/16 03:21:47 christos Exp $ */
 
 /*-
  * Copyright (c) 1985, 1986, 1992, 1993
@@ -288,6 +288,8 @@
 
 		/* Generate output characters in reverse order. */
 		while (zs->u.r.zs_code >= 256) {
+			if (zs->u.r.zs_stackp - de_stack >= HSIZE - 1)
+return -1;
 			*zs->u.r.zs_stackp++ = tab_suffixof(zs->u.r.zs_code);
 			zs->u.r.zs_code = tab_prefixof(zs->u.r.zs_code);
 		}



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

2011-08-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Tue Aug 16 02:59:16 UTC 2011

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
Fix broken build.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/xen/x86/cpu.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/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.63 src/sys/arch/xen/x86/cpu.c:1.64
--- src/sys/arch/xen/x86/cpu.c:1.63	Mon Aug 15 20:14:52 2011
+++ src/sys/arch/xen/x86/cpu.c	Tue Aug 16 02:59:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.63 2011/08/15 20:14:52 cherry Exp $	*/
+/*	$NetBSD: cpu.c,v 1.64 2011/08/16 02:59:16 dholland Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.63 2011/08/15 20:14:52 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.64 2011/08/16 02:59:16 dholland Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1292,5 +1292,5 @@
 void
 cpu_kick(struct cpu_info *ci)
 {
-	xen_send_ipi(ci, XEN_IPI_KICK);
+	(void)xen_send_ipi(ci, XEN_IPI_KICK);
 }



CVS commit: src/crypto/external/bsd/heimdal/dist/kdc

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 16 02:59:00 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc: kerberos5.c

Log Message:
add extra cast for systems where sizeof(time_t) < sizeof(intmax_t)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.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/heimdal/dist/kdc/kerberos5.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.3 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.4
--- src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.3	Mon Aug 15 21:14:57 2011
+++ src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c	Mon Aug 15 22:59:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kerberos5.c,v 1.3 2011/08/16 01:14:57 elric Exp $	*/
+/*	$NetBSD: kerberos5.c,v 1.4 2011/08/16 02:59:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2007 Kungliga Tekniska Högskolan
@@ -1268,7 +1268,7 @@
 			"client time %s is out by %jd > %jd seconds -- %s",
 			client_time,
 			imaxabs(kdc_time - p.patimestamp),
-			context->max_skew,
+			(intmax_t)context->max_skew,
 			client_name);
 
 		/*



CVS commit: src/crypto/external/bsd/heimdal/dist/kdc

2011-08-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Tue Aug 16 01:14:58 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc: kerberos5.c

Log Message:
We shouldn't cast client_time to (intmax_t) because it is a char * not
an integer.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.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/heimdal/dist/kdc/kerberos5.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.2 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.3
--- src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.2	Mon Aug 15 21:00:49 2011
+++ src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c	Tue Aug 16 01:14:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kerberos5.c,v 1.2 2011/08/15 21:00:49 christos Exp $	*/
+/*	$NetBSD: kerberos5.c,v 1.3 2011/08/16 01:14:57 elric Exp $	*/
 
 /*
  * Copyright (c) 1997-2007 Kungliga Tekniska Högskolan
@@ -1266,7 +1266,7 @@
  		kdc_log(context, config, 0,
 			"Too large time skew, "
 			"client time %s is out by %jd > %jd seconds -- %s",
-			(intmax_t)client_time,
+			client_time,
 			imaxabs(kdc_time - p.patimestamp),
 			context->max_skew,
 			client_name);



CVS commit: xsrc/external/mit/libXfont/dist/src/fontfile

2011-08-15 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Mon Aug 15 21:19:27 UTC 2011

Modified Files:
xsrc/external/mit/libXfont/dist/src/fontfile: decompress.c

Log Message:
P
Fix CVS-2011-2895, buffer overflow in decompress


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c

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/libXfont/dist/src/fontfile/decompress.c
diff -u xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c:1.1.1.2 xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c:1.2
--- xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c:1.1.1.2	Wed Jun 10 03:33:40 2009
+++ xsrc/external/mit/libXfont/dist/src/fontfile/decompress.c	Mon Aug 15 17:19:27 2011
@@ -261,6 +261,8 @@
  	 */
 	while ( code >= 256 )
 	{
+	if (stackp - de_stack >= STACK_SIZE - 1)
+		return BUFFILEEOF;
 	*stackp++ = file->tab_suffix[code];
 	code = file->tab_prefix[code];
 	}



CVS commit: src/dist/dhcp

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 15 21:12:44 UTC 2011

Modified Files:
src/dist/dhcp/common: discover.c options.c
src/dist/dhcp/server: dhcp.c

Log Message:
Fix CVS-2011-2748, malformed packets can cause server to crash causing a DoS.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/dist/dhcp/common/discover.c
cvs rdiff -u -r1.6 -r1.7 src/dist/dhcp/common/options.c
cvs rdiff -u -r1.11 -r1.12 src/dist/dhcp/server/dhcp.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/common/discover.c
diff -u src/dist/dhcp/common/discover.c:1.11 src/dist/dhcp/common/discover.c:1.12
--- src/dist/dhcp/common/discover.c:1.11	Wed Oct 31 11:26:51 2007
+++ src/dist/dhcp/common/discover.c	Mon Aug 15 17:12:43 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: discover.c,v 1.11 2007/10/31 15:26:51 gdt Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: discover.c,v 1.12 2011/08/15 21:12:43 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -830,6 +830,17 @@
 	}
 	if (result == 0)
 		return ISC_R_UNEXPECTED;
+	/*
+	 * If we didn't at least get the fixed portion of the BOOTP
+	 * packet, drop the packet.
+	 * Previously we allowed packets with no sname or filename
+	 * as we were aware of at least one client that did.  But
+	 * a bug caused short packets to not work and nobody has
+	 * complained, it seems rational to tighten up that
+	 * restriction.
+	 */
+	if (result < DHCP_FIXED_NON_UDP)
+ 		return ISC_R_UNEXPECTED;
 
 	if (bootp_packet_handler) {
 		ifrom.len = 4;

Index: src/dist/dhcp/common/options.c
diff -u src/dist/dhcp/common/options.c:1.6 src/dist/dhcp/common/options.c:1.7
--- src/dist/dhcp/common/options.c:1.6	Thu May 11 05:29:39 2006
+++ src/dist/dhcp/common/options.c	Mon Aug 15 17:12:43 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: options.c,v 1.6 2006/05/11 09:29:39 mrg Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: options.c,v 1.7 2011/08/15 21:12:43 christos Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #define DHCP_OPTION_DATA
@@ -499,19 +499,26 @@
 	   honor it. */
 
 	if (mms) {
-		main_buffer_size = mms - DHCP_FIXED_LEN;
+		if (mms < 576)
+			/* Enforce a minimum packet size... */
+			main_buffer_size = mms - DHCP_FIXED_LEN;
+		else if (mms > 1500)
+			/*
+			 * TODO: Packets longer than 1500 bytes really
+			 * should be allowed, but it requires upstream
+			 * changes to the way the packet is allocated.  For
+			 * now, we forbid them.  They won't be needed very
+			 * often anyway.
+			 */
+			main_buffer_size = 1500 - DHCP_FIXED_LEN;
+		else
+			main_buffer_size = mms - DHCP_FIXED_LEN;
 
-		/* Enforce a minimum packet size... */
-		if (main_buffer_size < (576 - DHCP_FIXED_LEN))
-			main_buffer_size = 576 - DHCP_FIXED_LEN;
 	} else if (bootpp) {
-		if (inpacket) {
-			main_buffer_size =
-inpacket -> packet_length - DHCP_FIXED_LEN;
-			if (main_buffer_size < 64)
-main_buffer_size = 64;
-		} else
-			main_buffer_size = 64;
+		main_buffer_size = 64;
+		if (inpacket != NULL &&
+		(inpacket->packet_length >= 64 + DHCP_FIXED_NON_UDP))
+			main_buffer_size = inpacket->packet_length - DHCP_FIXED_NON_UDP;
 	} else
 		main_buffer_size = 576 - DHCP_FIXED_LEN;
 

Index: src/dist/dhcp/server/dhcp.c
diff -u src/dist/dhcp/server/dhcp.c:1.11 src/dist/dhcp/server/dhcp.c:1.12
--- src/dist/dhcp/server/dhcp.c:1.11	Thu Jul 16 18:44:27 2009
+++ src/dist/dhcp/server/dhcp.c	Mon Aug 15 17:12:43 2011
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.11 2009/07/16 22:44:27 tonnerre Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.12 2011/08/15 21:12:43 christos Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -128,6 +128,7 @@
 	if (packet -> packet_type == DHCPREQUEST &&
 	packet -> raw -> ciaddr.s_addr &&
 	!packet -> raw -> giaddr.s_addr &&
+	packet -> options != NULL &&
 	(packet -> options -> universe_count < agent_universe.index ||
 	 !packet -> options -> universes [agent_universe.index]))
 	{
@@ -1379,6 +1380,7 @@
 	/* If there were agent options in the incoming packet, return
 	   them. */
 	if (packet -> raw -> giaddr.s_addr &&
+	packet -> options != NULL &&
 	packet -> options -> universe_count > agent_universe.index &&
 	packet -> options -> universes [agent_universe.index]) {
 		option_chain_head_reference
@@ -1536,6 +1538,7 @@
 	   them.  Do not return the agent options if they were stashed
 	   on the lease. */
 	if (packet -> raw -> giaddr.s_addr &&
+	packet -> optio

CVS commit: src/crypto/external/bsd/heimdal/dist/kdc

2011-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 15 21:00:50 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc: kerberos5.c

Log Message:
use intmax_t to print times.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.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/heimdal/dist/kdc/kerberos5.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.2
--- src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.1.1.1	Wed Apr 13 14:14:37 2011
+++ src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c	Mon Aug 15 17:00:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kerberos5.c,v 1.1.1.1 2011/04/13 18:14:37 elric Exp $	*/
+/*	$NetBSD: kerberos5.c,v 1.2 2011/08/15 21:00:49 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2007 Kungliga Tekniska Högskolan
@@ -1265,9 +1265,9 @@
  		ret = KRB5KRB_AP_ERR_SKEW;
  		kdc_log(context, config, 0,
 			"Too large time skew, "
-			"client time %s is out by %u > %u seconds -- %s",
-			client_time,
-			(unsigned)abs(kdc_time - p.patimestamp),
+			"client time %s is out by %jd > %jd seconds -- %s",
+			(intmax_t)client_time,
+			imaxabs(kdc_time - p.patimestamp),
 			context->max_skew,
 			client_name);
 



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

2011-08-15 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Aug 15 20:17:12 UTC 2011

Modified Files:
src/sys/arch/xen/x86: xen_ipi.c

Log Message:
invert buggy ci_flag test


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/x86/xen_ipi.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/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.3 src/sys/arch/xen/x86/xen_ipi.c:1.4
--- src/sys/arch/xen/x86/xen_ipi.c:1.3	Wed Aug 10 20:38:45 2011
+++ src/sys/arch/xen/x86/xen_ipi.c	Mon Aug 15 20:17:12 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.3 2011/08/10 20:38:45 cherry Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.4 2011/08/15 20:17:12 cherry Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.3 2011/08/10 20:38:45 cherry Exp $"); 
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.4 2011/08/15 20:17:12 cherry Exp $"); 
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.3 2011/08/10 20:38:45 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.4 2011/08/15 20:17:12 cherry Exp $");
 
 #include 
 
@@ -158,7 +158,7 @@
 
 	KASSERT(ci != NULL || ci != curcpu());
 
-	if ((ci->ci_flags & CPUF_RUNNING) != 0) {
+	if ((ci->ci_flags & CPUF_RUNNING) == 0) {
 		return ENOENT;
 	}
 



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

2011-08-15 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Aug 15 20:14:52 UTC 2011

Modified Files:
src/sys/arch/xen/x86: cpu.c

Log Message:
Do not panic() on xen_send_ipi() sent to a cpu not yet running.
x86 MP boot depends on this strange behaviour.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/x86/cpu.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/x86/cpu.c
diff -u src/sys/arch/xen/x86/cpu.c:1.62 src/sys/arch/xen/x86/cpu.c:1.63
--- src/sys/arch/xen/x86/cpu.c:1.62	Sat Aug 13 12:37:30 2011
+++ src/sys/arch/xen/x86/cpu.c	Mon Aug 15 20:14:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.62 2011/08/13 12:37:30 cherry Exp $	*/
+/*	$NetBSD: cpu.c,v 1.63 2011/08/15 20:14:52 cherry Exp $	*/
 /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp  */
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.62 2011/08/13 12:37:30 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.63 2011/08/15 20:14:52 cherry Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1292,8 +1292,5 @@
 void
 cpu_kick(struct cpu_info *ci)
 {
-	if (xen_send_ipi(ci, XEN_IPI_KICK) != 0) {
-		panic("xen_send_ipi(%s, XEN_IPI_KICK) failed\n",
-		cpu_name(ci));
-	}
+	xen_send_ipi(ci, XEN_IPI_KICK);
 }



CVS commit: src/external/gpl3/gcc/lib/libgcc

2011-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 15 18:31:20 UTC 2011

Modified Files:
src/external/gpl3/gcc/lib/libgcc: Makefile.inc

Log Message:
also copy -m and -f flags from the GCC headers.

fixes PR#45253.  (i'm going to leave that bug open for now because i
want to re-work a bunch of the libgcc framework.)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc/lib/libgcc/Makefile.inc

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

Modified files:

Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc
diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.11 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.12
--- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.11	Mon Aug 15 09:19:21 2011
+++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc	Mon Aug 15 18:31:20 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.11 2011/08/15 09:19:21 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.12 2011/08/15 18:31:20 mrg Exp $
 
 .if ${MKGCC} != "no"
 .if exists(${.CURDIR}/../arch/${MACHINE_ARCH}.mk)
@@ -17,6 +17,7 @@
 GCPPFLAGS=	${G_LIBGCC2_CFLAGS} ${G_USE_COLLECT2} ${G_INCLUDES}
 CPPFLAGS+=	-I${.CURDIR} -I${GCCARCHLIBGCC}
 CPPFLAGS+=	-I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
+CPPFLAGS+=	${GCPPFLAGS:M-m*} ${GCPPFLAGS:M-f*}
 CPPFLAGS+=	${G_EXTRA_HEADERS:M/*:H:u:S/^/-I/g}
 CPPFLAGS+=	-I${DIST} -I${DIST}/gcc/cp -I${DIST}/gcc/config -I${GCCARCHXX} -I.
 



CVS commit: src/sys/dev/ic

2011-08-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Aug 15 18:24:34 UTC 2011

Modified Files:
src/sys/dev/ic: wi.c wivar.h

Log Message:
Use a recursive lock to ensure that only on thread is in wi_ioctl() at
one time.  It's a recursive lock because sometimes wi_ioctl() recurses
through the network stack (ick).


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/dev/ic/wi.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/ic/wivar.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/ic/wi.c
diff -u src/sys/dev/ic/wi.c:1.234 src/sys/dev/ic/wi.c:1.235
--- src/sys/dev/ic/wi.c:1.234	Tue Nov 23 04:33:09 2010
+++ src/sys/dev/ic/wi.c	Mon Aug 15 18:24:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wi.c,v 1.234 2010/11/23 04:33:09 christos Exp $	*/
+/*	$NetBSD: wi.c,v 1.235 2011/08/15 18:24:34 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -99,7 +99,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.234 2010/11/23 04:33:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.235 2011/08/15 18:24:34 dyoung Exp $");
 
 #define WI_HERMES_AUTOINC_WAR	/* Work around data write autoinc bug. */
 #define WI_HERMES_STATS_WAR	/* Work around stats counter bug. */
@@ -151,6 +151,11 @@
 STATIC int  wi_media_change(struct ifnet *);
 STATIC void wi_media_status(struct ifnet *, struct ifmediareq *);
 
+static void wi_ioctl_init(struct wi_softc *);
+static int wi_ioctl_enter(struct wi_softc *);
+static void wi_ioctl_exit(struct wi_softc *);
+static void wi_ioctl_drain(struct wi_softc *);
+
 STATIC struct ieee80211_node *wi_node_alloc(struct ieee80211_node_table *);
 STATIC void wi_node_free(struct ieee80211_node *);
 
@@ -373,6 +378,8 @@
 	};
 	int s;
 
+	wi_ioctl_init(sc);
+
 	s = splnet();
 
 	/* Make sure interrupts are disabled. */
@@ -595,6 +602,7 @@
 	ieee80211_ifdetach(&sc->sc_ic);
 	if_detach(ifp);
 	splx(s);
+	wi_ioctl_drain(sc);
 	return 0;
 }
 
@@ -1289,6 +1297,67 @@
 	ieee80211_watchdog(&sc->sc_ic);
 }
 
+static int
+wi_ioctl_enter(struct wi_softc *sc)
+{
+	int rc = 0;
+
+	mutex_enter(&sc->sc_ioctl_mtx);
+	sc->sc_ioctl_nwait++;
+	while (sc->sc_ioctl_lwp != NULL && sc->sc_ioctl_lwp != curlwp) {
+		rc = sc->sc_ioctl_gone
+		? ENXIO
+		: cv_wait_sig(&sc->sc_ioctl_cv, &sc->sc_ioctl_mtx);
+		if (rc != 0)
+			break;
+	}
+	if (rc == 0) {
+		sc->sc_ioctl_lwp = curlwp;
+		sc->sc_ioctl_depth++;
+	}
+	if (--sc->sc_ioctl_nwait == 0)
+		cv_signal(&sc->sc_ioctl_cv);
+	mutex_exit(&sc->sc_ioctl_mtx);
+	return rc;
+}
+
+static void
+wi_ioctl_exit(struct wi_softc *sc)
+{
+	KASSERT(sc->sc_ioctl_lwp == curlwp);
+	mutex_enter(&sc->sc_ioctl_mtx);
+	if (--sc->sc_ioctl_depth == 0) {
+		sc->sc_ioctl_lwp = NULL;
+		cv_signal(&sc->sc_ioctl_cv);
+	}
+	mutex_exit(&sc->sc_ioctl_mtx);
+}
+
+static void
+wi_ioctl_init(struct wi_softc *sc)
+{
+	mutex_init(&sc->sc_ioctl_mtx, MUTEX_DEFAULT, IPL_NONE);
+	cv_init(&sc->sc_ioctl_cv, device_xname(sc->sc_dev));
+}
+
+static void
+wi_ioctl_drain(struct wi_softc *sc)
+{
+	wi_ioctl_enter(sc);
+
+	mutex_enter(&sc->sc_ioctl_mtx);
+	sc->sc_ioctl_gone = true;
+	cv_broadcast(&sc->sc_ioctl_cv);
+	while (sc->sc_ioctl_nwait != 0)
+		cv_wait(&sc->sc_ioctl_cv, &sc->sc_ioctl_mtx);
+	mutex_exit(&sc->sc_ioctl_mtx);
+
+	wi_ioctl_exit(sc);
+
+	mutex_destroy(&sc->sc_ioctl_mtx);
+	cv_destroy(&sc->sc_ioctl_cv);
+}
+
 STATIC int
 wi_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
@@ -1302,6 +1371,9 @@
 
 	s = splnet();
 
+	if ((error = wi_ioctl_enter(sc)) != 0)
+		return error;
+
 	switch (cmd) {
 	case SIOCSIFFLAGS:
 		if ((error = ifioctl_common(ifp, cmd, data)) != 0)
@@ -1374,6 +1446,7 @@
 		break;
 	}
 	wi_mend_flags(sc, ic->ic_state);
+	wi_ioctl_exit(sc);
 	splx(s);
 	return error;
 }

Index: src/sys/dev/ic/wivar.h
diff -u src/sys/dev/ic/wivar.h:1.64 src/sys/dev/ic/wivar.h:1.65
--- src/sys/dev/ic/wivar.h:1.64	Tue Nov 23 04:33:09 2010
+++ src/sys/dev/ic/wivar.h	Mon Aug 15 18:24:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wivar.h,v 1.64 2010/11/23 04:33:09 christos Exp $	*/
+/*	$NetBSD: wivar.h,v 1.65 2011/08/15 18:24:34 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999
@@ -32,6 +32,10 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include 
+#include 
+#include 
+
 /* Radio capture format for Prism. */
 
 #define WI_RX_RADIOTAP_PRESENT	((1 << IEEE80211_RADIOTAP_FLAGS) | \
@@ -166,6 +170,12 @@
 	/* number of transmissions pending at each data rate */
 	u_int8_t		sc_txpending[IEEE80211_RATE_MAXSIZE];
 	struct callout		sc_rssadapt_ch;
+	kmutex_t		sc_ioctl_mtx;
+	kcondvar_t		sc_ioctl_cv;
+	bool			sc_ioctl_gone;
+	unsigned int		sc_ioctl_nwait;
+	unsigned int		sc_ioctl_depth;
+	lwp_t			*sc_ioctl_lwp;
 };
 
 #define	sc_if		sc_ec.ec_if



CVS commit: src/sys/dev/pcmcia

2011-08-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Aug 15 18:04:59 UTC 2011

Modified Files:
src/sys/dev/pcmcia: if_wi_pcmcia.c

Log Message:
Don't test truth of a pointer or assign 0 to it but compare / assign
NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/pcmcia/if_wi_pcmcia.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/pcmcia/if_wi_pcmcia.c
diff -u src/sys/dev/pcmcia/if_wi_pcmcia.c:1.88 src/sys/dev/pcmcia/if_wi_pcmcia.c:1.89
--- src/sys/dev/pcmcia/if_wi_pcmcia.c:1.88	Mon Aug 15 17:08:00 2011
+++ src/sys/dev/pcmcia/if_wi_pcmcia.c	Mon Aug 15 18:04:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wi_pcmcia.c,v 1.88 2011/08/15 17:08:00 dyoung Exp $ */
+/* $NetBSD: if_wi_pcmcia.c,v 1.89 2011/08/15 18:04:59 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.88 2011/08/15 17:08:00 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.89 2011/08/15 18:04:59 dyoung Exp $");
 
 #include 
 #include 
@@ -271,13 +271,13 @@
 	if (onoff) {
 		/* establish the interrupt. */
 		sc->sc_ih = pcmcia_intr_establish(pf, IPL_NET, wi_intr, sc);
-		if (!sc->sc_ih)
+		if (sc->sc_ih == NULL)
 			return EIO;
 
 		error = pcmcia_function_enable(pf);
 		if (error) {
 			pcmcia_intr_disestablish(pf, sc->sc_ih);
-			sc->sc_ih = 0;
+			sc->sc_ih = NULL;
 			return EIO;
 		}
 



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-15 Thread Jeff Rizzo
Module Name:othersrc
Committed By:   riz
Date:   Mon Aug 15 17:46:37 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsic_daemonif.c
iscsic_driverif.c

Log Message:
Don't bother casting the unused return of snprintf()/memset() to (void).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c

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

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c	Mon Aug 15 17:46:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_daemonif.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
+/*	$NetBSD: iscsic_daemonif.c,v 1.3 2011/08/15 17:46:36 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -518,7 +518,7 @@
 	iscsid_add_isns_server_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	(void) memset(&arg, 0x0, sizeof(arg));
+	memset(&arg, 0x0, sizeof(arg));
 	if (!(cl_get_isns(&arg, argc, argv))) {
 		arg_missing("Server Address");
 	}
@@ -621,7 +621,7 @@
 	iscsid_sym_id_t req;
 	unsigned i;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	check_extra_args(argc, argv);
 
 	/* get the list of servers */
@@ -682,7 +682,7 @@
 	iscsid_add_initiator_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	if (!cl_get_string('a', (char *)req.address, argc, argv)) {
 		arg_missing("Interface Address");
 	}
@@ -717,7 +717,7 @@
 	iscsid_sym_id_t req;
 	iscsid_response_t *rsp;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	if (!cl_get_id('I', &req, argc, argv)) {
 		arg_missing("Initiator Portal ID");
 	}
@@ -753,7 +753,7 @@
 	iscsid_sym_id_t req;
 	unsigned i;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	check_extra_args(argc, argv);
 
 	/* get the list of servers */
@@ -894,7 +894,7 @@
 	iscsid_login_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	(void) memset(&loginp, 0x0, sizeof(loginp));
+	memset(&loginp, 0x0, sizeof(loginp));
 	loginp.login_type = (cl_get_opt('m', argc, argv))
 		? ISCSI_LOGINTYPE_NOMAP : ISCSI_LOGINTYPE_MAP;
 
@@ -962,7 +962,7 @@
 	iscsid_login_req_t loginp;
 	iscsid_response_t *rsp;
 
-	(void) memset(&loginp, 0x0, sizeof(loginp));
+	memset(&loginp, 0x0, sizeof(loginp));
 	loginp.login_type = ISCSI_LOGINTYPE_MAP;
 	cl_get_id('I', &loginp.session_id, argc, argv);
 
@@ -1043,8 +1043,8 @@
 	unsigned j;
 	int lconn;
 
-	(void) memset(&creq, 0x0, sizeof(creq));
-	(void) memset(&clreq, 0x0, sizeof(clreq));
+	memset(&creq, 0x0, sizeof(creq));
+	memset(&clreq, 0x0, sizeof(clreq));
 	lconn = cl_get_opt('c', argc, argv);
 
 	check_extra_args(argc, argv);
@@ -1117,7 +1117,7 @@
 	iscsid_response_t *rsp;
 	uint64_t isid;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	if (!cl_get_string('n', (char *)req.InitiatorName, argc, argv)) {
 		arg_missing("Initiator Name");
 	}
Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c	Mon Aug 15 17:46:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_driverif.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
+/*	$NetBSD: iscsic_driverif.c,v 1.3 2011/08/15 17:46:36 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -336,7 +336,7 @@
 	for (pt = asctab; pt->key != NULL && asc >= pt->asc; pt++) {
 		if (asc == pt->asc && ascq == pt->ascq) {
 			bp = (char *)&buf[1024];
-			(void) snprintf(bp, sizeof(buf) - 1024, "%s: %s",
+			snprintf(bp, sizeof(buf) - 1024, "%s: %s",
 	str, pt->key);
 			return bp;
 		}
@@ -373,38 +373,38 @@
 	if (io->req.senselen_used) {
 		switch (io->req.sense[2] & 0x0f) {
 		case 0x01:
-			(void) snprintf(esp = es, sizeof(es), "Recovered Error");
+			snprintf(esp = es, sizeof(es), "Recovered Error");
 			break;
 		case 0x02:
-			(void) snprintf(esp = es, sizeof(es), "Not Ready");
+			snprintf(esp = es, sizeof(es), "Not Ready");
 			break;
 		case 0x03:
-			(void) snprintf(esp = es, sizeof(es), "Medium Error");
+			snprintf(esp = es, sizeof(es), "Medium Error");
 			break;
 		case 0x04:
-			(void) snprintf(esp = es, sizeof(es), "Hardware Error");
+			snprintf(esp = es, sizeof(es), "Hardware Error");
 			break;
 		case 0x05:
-			(void) snpri

CVS commit: src/sys/dev/pcmcia

2011-08-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Aug 15 17:08:01 UTC 2011

Modified Files:
src/sys/dev/pcmcia: if_wi_pcmcia.c

Log Message:
Remove superfluous parentheses in return statements.  No change in the
generated assembly.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/pcmcia/if_wi_pcmcia.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/pcmcia/if_wi_pcmcia.c
diff -u src/sys/dev/pcmcia/if_wi_pcmcia.c:1.87 src/sys/dev/pcmcia/if_wi_pcmcia.c:1.88
--- src/sys/dev/pcmcia/if_wi_pcmcia.c:1.87	Mon Aug 15 17:01:28 2011
+++ src/sys/dev/pcmcia/if_wi_pcmcia.c	Mon Aug 15 17:08:00 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wi_pcmcia.c,v 1.87 2011/08/15 17:01:28 dyoung Exp $ */
+/* $NetBSD: if_wi_pcmcia.c,v 1.88 2011/08/15 17:08:00 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.87 2011/08/15 17:01:28 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.88 2011/08/15 17:08:00 dyoung Exp $");
 
 #include 
 #include 
@@ -256,8 +256,8 @@
 
 	if (pcmcia_product_lookup(pa, wi_pcmcia_products, wi_pcmcia_nproducts,
 	sizeof(wi_pcmcia_products[0]), NULL))
-		return (1);
-	return (0);
+		return 1;
+	return 0;
 }
 
 static int
@@ -315,9 +315,9 @@
 	if (cfe->iftype != PCMCIA_IFTYPE_IO ||
 	cfe->num_iospace != 1 ||
 	cfe->iospace[0].length < WI_IOSIZE)
-		return (EINVAL);
+		return EINVAL;
 	cfe->num_memspace = 0;
-	return (0);
+	return 0;
 }
 
 static void
@@ -397,18 +397,18 @@
 	int error;
 
 	if (psc->sc_state != WI_PCMCIA_ATTACHED)
-		return (0);
+		return 0;
 
 	error = wi_detach(&psc->sc_wi);
 	if (error != 0)
-		return (error);
+		return error;
 
 	if (sc->sc_ih != NULL)
 		pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
 
 	pcmcia_function_unconfigure(psc->sc_pf);
 
-	return (0);
+	return 0;
 }
 
 /*



CVS commit: src/sys/dev/pcmcia

2011-08-15 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon Aug 15 17:01:28 UTC 2011

Modified Files:
src/sys/dev/pcmcia: if_wi_pcmcia.c

Log Message:
Only try to disestablish the interrupt handler if the handler was
previously established.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/pcmcia/if_wi_pcmcia.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/pcmcia/if_wi_pcmcia.c
diff -u src/sys/dev/pcmcia/if_wi_pcmcia.c:1.86 src/sys/dev/pcmcia/if_wi_pcmcia.c:1.87
--- src/sys/dev/pcmcia/if_wi_pcmcia.c:1.86	Tue Nov 23 04:33:10 2010
+++ src/sys/dev/pcmcia/if_wi_pcmcia.c	Mon Aug 15 17:01:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wi_pcmcia.c,v 1.86 2010/11/23 04:33:10 christos Exp $ */
+/* $NetBSD: if_wi_pcmcia.c,v 1.87 2011/08/15 17:01:28 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.86 2010/11/23 04:33:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.87 2011/08/15 17:01:28 dyoung Exp $");
 
 #include 
 #include 
@@ -300,8 +300,10 @@
 		DELAY(1000);
 	} else {
 		pcmcia_function_disable(psc->sc_pf);
-		pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
-		sc->sc_ih = 0;
+		if (sc->sc_ih != NULL) {
+			pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
+			sc->sc_ih = NULL;
+		}
 	}
 
 	return 0;
@@ -391,6 +393,7 @@
 wi_pcmcia_detach(device_t self, int flags)
 {
 	struct wi_pcmcia_softc *psc = device_private(self);
+	struct wi_softc *sc = &psc->sc_wi;
 	int error;
 
 	if (psc->sc_state != WI_PCMCIA_ATTACHED)
@@ -400,6 +403,9 @@
 	if (error != 0)
 		return (error);
 
+	if (sc->sc_ih != NULL)
+		pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
+
 	pcmcia_function_unconfigure(psc->sc_pf);
 
 	return (0);



CVS commit: src/tests/lib/librumpclient

2011-08-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Aug 15 15:19:09 UTC 2011

Modified Files:
src/tests/lib/librumpclient: t_fd.c

Log Message:
As the sigio test case is currently failing with "sigcnt != 1", print the
actual sigcnt value to aid in diagnosing the problem.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/librumpclient/t_fd.c

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

Modified files:

Index: src/tests/lib/librumpclient/t_fd.c
diff -u src/tests/lib/librumpclient/t_fd.c:1.2 src/tests/lib/librumpclient/t_fd.c:1.3
--- src/tests/lib/librumpclient/t_fd.c:1.2	Sun Feb 20 13:27:46 2011
+++ src/tests/lib/librumpclient/t_fd.c	Mon Aug 15 15:19:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_fd.c,v 1.2 2011/02/20 13:27:46 pooka Exp $	*/
+/*	$NetBSD: t_fd.c,v 1.3 2011/08/15 15:19:08 gson Exp $	*/
 
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -106,6 +106,7 @@
 	int ls;
 	int cs;
 	int fl;
+	int sc;
 
 	signal(SIGIO, gotsig);
 	RZ(system("rump_server -lrumpnet -lrumpnet_net -lrumpnet_netinet "
@@ -131,7 +132,9 @@
 
 	ATF_REQUIRE_EQ(sigcnt, 0);
 	RL(rump_sys_connect(cs, (struct sockaddr *)&sin, sizeof(sin)));
-	ATF_REQUIRE_EQ(sigcnt, 1);
+	sc = sigcnt;
+	printf("sigcnt after connect: %d\n", sc);
+	ATF_REQUIRE_EQ(sc, 1);
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/distrib/sets/lists

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 15:14:01 UTC 2011

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: ad.powerpc md.amd64 md.i386 mi

Log Message:
Mark a few gcc-4.1 entries as obsolete with gcc-4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.946 -r1.947 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.56 -r1.57 src/distrib/sets/lists/comp/ad.powerpc
cvs rdiff -u -r1.128 -r1.129 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.122 -r1.123 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.1661 -r1.1662 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/base/mi
diff -u src/distrib/sets/lists/base/mi:1.946 src/distrib/sets/lists/base/mi:1.947
--- src/distrib/sets/lists/base/mi:1.946	Thu Aug  4 03:38:54 2011
+++ src/distrib/sets/lists/base/mi	Mon Aug 15 15:13:59 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.946 2011/08/04 03:38:54 matt Exp $
+# $NetBSD: mi,v 1.947 2011/08/15 15:13:59 wiz Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -818,7 +818,8 @@
 ./usr/include/g++/stdbase-obsolete		obsolete
 ./usr/include/g++/tr1base-cxx-usr
 ./usr/include/g++/tr1_impl			base-cxx-usr
-./usr/include/gcc-4.1base-c-usr
+./usr/include/gcc-4.1base-c-usr		gcc=4
+./usr/include/gcc-4.1base-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.5base-c-usr
 ./usr/include/gssapibase-c-usr
 ./usr/include/gssapi/rpc			base-obsolete		obsolete

Index: src/distrib/sets/lists/comp/ad.powerpc
diff -u src/distrib/sets/lists/comp/ad.powerpc:1.56 src/distrib/sets/lists/comp/ad.powerpc:1.57
--- src/distrib/sets/lists/comp/ad.powerpc:1.56	Sun Jul 17 20:54:31 2011
+++ src/distrib/sets/lists/comp/ad.powerpc	Mon Aug 15 15:14:00 2011
@@ -1,9 +1,10 @@
-# $NetBSD: ad.powerpc,v 1.56 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: ad.powerpc,v 1.57 2011/08/15 15:14:00 wiz Exp $
 ./usr/bin/elf2aoutcomp-sysutil-bin
 ./usr/bin/psim	comp-debug-bin		gdb,gdb=6
 ./usr/include/altivec.hcomp-obsolete		obsolete
 ./usr/include/clang-3.0/altivec.h		comp-c-include		llvm
 ./usr/include/gcc-4.1/altivec.h			comp-c-include		gcccmds,gcc=4
+./usr/include/gcc-4.1/altivec.h			comp-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.5/altivec.h			comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/paired.h			comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/ppc-asm.h			comp-c-include		gcccmds,gcc=45

Index: src/distrib/sets/lists/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.128 src/distrib/sets/lists/comp/md.amd64:1.129
--- src/distrib/sets/lists/comp/md.amd64:1.128	Tue Jul 26 16:10:16 2011
+++ src/distrib/sets/lists/comp/md.amd64	Mon Aug 15 15:14:00 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.128 2011/07/26 16:10:16 joerg Exp $
+# $NetBSD: md.amd64,v 1.129 2011/08/15 15:14:00 wiz Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -79,16 +79,21 @@
 ./usr/include/clang-3.0/xmmintrin.h		comp-c-include		llvm
 ./usr/include/emmintrin.h			comp-obsolete		obsolete
 ./usr/include/gcc-4.1/emmintrin.h		comp-c-include		gcccmds,gcc=4
+./usr/include/gcc-4.1/emmintrin.h		comp-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.1/mm_malloc.h		comp-c-include		gcccmds,gcc=4
+./usr/include/gcc-4.1/mm_malloc.h		comp-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.1/mmintrin.h		comp-c-include		gcccmds,gcc=4
+./usr/include/gcc-4.1/mmintrin.h		comp-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.1/pmmintrin.h		comp-c-include		gcccmds,gcc=4
+./usr/include/gcc-4.1/pmmintrin.h		comp-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.1/xmmintrin.h		comp-c-include		gcccmds,gcc=4
+./usr/include/gcc-4.1/xmmintrin.h		comp-obsolete		gcc=45,obsolete
 ./usr/include/gcc-4.5/abmintrin.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/ammintrin.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/avxintrin.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/bmmintrin.h		comp-c-include		gcccmds,gcc=45
-./usr/include/gcc-4.5/cross-stdarg.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/cpuid.h			comp-c-include		gcccmds,gcc=45
+./usr/include/gcc-4.5/cross-stdarg.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/emmintrin.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/fma4intrin.h		comp-c-include		gcccmds,gcc=45
 ./usr/include/gcc-4.5/ia32intrin.h		comp-c-include		gcccmds,gcc=45

Index: src/distrib/sets/lists/comp/md.i386
diff -u src/distrib/sets/lists/comp/md.i386:1.122 src/distrib/sets/lists/comp/md.i386:1.123
--- src/distrib/sets/lists/comp/md.i386:1.122	Sun Jul 17 20:54:31 2011
+++ src/distrib/sets/lists/comp/md.i386	Mon Aug 15 15:14:00 2011
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.122 2011/07/17 20:54:31 joerg Exp $
+# $NetBSD: md.i386,v 1.123

CVS commit: src

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 14:48:01 UTC 2011

Modified Files:
src: build.sh

Log Message:
Add `-h' and `-y' to `Usage' (which were missing there);
synchronize the options list from `Usage' with its own summary,
 and re-outline that list;
two corrections in the order of the options in (parseoptions) list;
a small punctuation change;
remove trailing whitespace in one line.

>From Snader_LB.


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

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.245 src/build.sh:1.246
--- src/build.sh:1.245	Mon Aug  8 22:15:42 2011
+++ src/build.sh	Mon Aug 15 14:48:00 2011
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.245 2011/08/08 22:15:42 jmcneill Exp $
+#	$NetBSD: build.sh,v 1.246 2011/08/15 14:48:00 wiz Exp $
 #
 # Copyright (c) 2001-2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -596,7 +596,7 @@
 	fi
 	cat <<_usage_
 
-Usage: ${progname} [-EnorUux] [-a arch] [-B buildid] [-C cdextras]
+Usage: ${progname} [-EhnorUuxy] [-a arch] [-B buildid] [-C cdextras]
 [-D dest] [-j njob] [-M obj] [-m mach] [-N noisy]
 [-O obj] [-R release] [-S seed] [-T tools]
 [-V var=[value]] [-w wrapper] [-X x11src] [-Y extsrcsrc]
@@ -634,46 +634,46 @@
 params  Display various make(1) parameters.
 
  Options:
--a arch Set MACHINE_ARCH to arch.  [Default: deduced from MACHINE]
--B buildId  Set BUILDID to buildId.
--C cdextras Append cdextras to CDEXTRA variable for inclusion on CD-ROM.
--D dest Set DESTDIR to dest.  [Default: destdir.MACHINE]
--E  Set "expert" mode; disables various safety checks.
-Should not be used without expert knowledge of the build system.
--h  Print this help message.
--j njob Run up to njob jobs in parallel; see make(1) -j.
--M obj  Set obj root directory to obj; sets MAKEOBJDIRPREFIX.
-Unsets MAKEOBJDIR.
--m mach Set MACHINE to mach; not required if NetBSD native.
--N noisySet the noisyness (MAKEVERBOSE) level of the build:
-0   Minimal output ("quiet")
-1   Describe what is occurring
-2   Describe what is occurring and echo the actual command
-3   Ignore the effect of the "@" prefix in make commands
-4   Trace shell commands using the shell's -x flag
-[Default: 2]
--n  Show commands that would be executed, but do not execute them.
--O obj  Set obj root directory to obj; sets a MAKEOBJDIR pattern.
-Unsets MAKEOBJDIRPREFIX.
--o  Set MKOBJDIRS=no; do not create objdirs at start of build.
--R release  Set RELEASEDIR to release.  [Default: releasedir]
--r  Remove contents of TOOLDIR and DESTDIR before building.
--S seed Set BUILDSEED to seed.  [Default: NetBSD-majorversion]
--T toolsSet TOOLDIR to tools.  If unset, and TOOLDIR is not set in
-the environment, ${toolprefix}make will be (re)built unconditionally.
--U  Set MKUNPRIVED=yes; build without requiring root privileges,
-install from an UNPRIVED build with proper file permissions.
--u  Set MKUPDATE=yes; do not run "make cleandir" first.
-Without this, everything is rebuilt, including the tools.
--V v=[val]  Set variable \`v' to \`val'.
--w wrapper  Create ${toolprefix}make script as wrapper.
-[Default: \${TOOLDIR}/bin/${toolprefix}make-\${MACHINE}]
--X x11src   Set X11SRCDIR to x11src.  [Default: /usr/xsrc]
--x  Set MKX11=yes; build X11 from X11SRCDIR
--Y extsrcsrc
-Set EXTSRCSRCDIR to extsrcsrc.  [Default: /usr/extsrc]
--y  Set MKEXTSRC=yes; build extsrc from EXTSRCSRCDIR
--Z vUnset ("zap") variable \`v'.
+-a archSet MACHINE_ARCH to arch.  [Default: deduced from MACHINE]
+-B buildid Set BUILDID to buildid.
+-C cdextrasAppend cdextras to CDEXTRA variable for inclusion on CD-ROM.
+-D destSet DESTDIR to dest.  [Default: destdir.MACHINE]
+-E Set "expert" mode; disables various safety checks.
+   Should not be used without expert knowledge of the build system.
+-h Print this help message.
+-j njobRun up to njob jobs in parallel; see make(1) -j.
+-M obj Set obj root directory to obj; sets MAKEOBJDIRPREFIX.
+   Unsets MAKEOBJDIR.
+-m machSet MACHINE to mach; not required if NetBSD native.
+-N noisy   Set the noisyness (MAKEVERBOSE) level of the build:
+   0   Minimal output ("quiet")
+   1   Describe what is

CVS commit: src/bin/sleep

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 14:45:36 UTC 2011

Modified Files:
src/bin/sleep: sleep.1

Log Message:
Improve wording.
>From Snader_LB.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/bin/sleep/sleep.1

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

Modified files:

Index: src/bin/sleep/sleep.1
diff -u src/bin/sleep/sleep.1:1.21 src/bin/sleep/sleep.1:1.22
--- src/bin/sleep/sleep.1:1.21	Sat Oct  9 07:40:58 2010
+++ src/bin/sleep/sleep.1	Mon Aug 15 14:45:36 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sleep.1,v 1.21 2010/10/09 07:40:58 wiz Exp $
+.\"	$NetBSD: sleep.1,v 1.22 2011/08/15 14:45:36 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)sleep.1	8.3 (Berkeley) 4/18/94
 .\"
-.Dd October 9, 2010
+.Dd August 13, 2011
 .Dt SLEEP 1
 .Os
 .Sh NAME
@@ -79,13 +79,13 @@
 .Pp
 .Dl (sleep 1800; sh command_file \*[Gt]\*[Am] errors)\*[Am]
 .Pp
-This incantation would wait a half hour before
+This incantation would wait half an hour before
 running the script command_file.
 (See the
 .Xr at 1
 utility.)
 .Pp
-To reiteratively run a command (with the
+To reiteratively run a command (with
 .Xr csh 1 ) :
 .Pp
 .Bd -literal -offset indent -compact



CVS commit: src/usr.sbin/makefs

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 14:45:01 UTC 2011

Modified Files:
src/usr.sbin/makefs: makefs.8 makefs.c

Log Message:
Re-order `usage' alphabetically;
rename option arguments in the manpage's `SYNOPSIS' section to
match those from `usage' (not the other way around; the `usage'-line
(and other parts of makefs.c) contain the correct names);
minor punctuation improvements.

>From Snader_LB.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.29 -r1.30 src/usr.sbin/makefs/makefs.c

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

Modified files:

Index: src/usr.sbin/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.35 src/usr.sbin/makefs/makefs.8:1.36
--- src/usr.sbin/makefs/makefs.8:1.35	Fri Jul 22 13:04:00 2011
+++ src/usr.sbin/makefs/makefs.8	Mon Aug 15 14:45:01 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makefs.8,v 1.35 2011/07/22 13:04:00 wiz Exp $
+.\"	$NetBSD: makefs.8,v 1.36 2011/08/15 14:45:01 wiz Exp $
 .\"
 .\" Copyright (c) 2001-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 July 18, 2011
+.Dd August 13, 2011
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -42,10 +42,10 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl x
-.Op Fl B Ar byte-order
+.Op Fl B Ar endian
 .Op Fl b Ar free-blocks
 .Op Fl d Ar debug-mask
-.Op Fl F Ar specfile
+.Op Fl F Ar mtree-specfile
 .Op Fl f Ar free-files
 .Op Fl M Ar minimum-size
 .Op Fl m Ar maximum-size
@@ -67,9 +67,9 @@
 .Pp
 The options are as follows:
 .Bl -tag -width flag
-.It Fl B Ar byte-order
+.It Fl B Ar endian
 Set the byte order of the image to
-.Ar byte-order .
+.Ar endian .
 Valid byte orders are
 .Ql 4321 ,
 .Ql big ,
@@ -97,9 +97,9 @@
 set in
 .Ar debug-mask .
 XXX: document these
-.It Fl F Ar specfile
+.It Fl F Ar mtree-specfile
 Use
-.Ar specfile
+.Ar mtree-specfile
 as an
 .Xr mtree 8
 .Sq specfile
@@ -156,13 +156,13 @@
 .Ar maximum-size .
 An error will be raised if the target file system needs to be larger
 than this to accommodate the provided directory tree.
-.It Fl N Ar dbdir
+.It Fl N Ar userdb-dir
 Use the user database text file
 .Pa master.passwd
 and group database text file
 .Pa group
 from
-.Ar dbdir ,
+.Ar userdb-dir ,
 rather than using the results from the system's
 .Xr getpwnam 3
 and
@@ -352,7 +352,7 @@
 .Sh AUTHORS
 .An Luke Mewburn
 .Aq lu...@netbsd.org
-(original program)
+(original program),
 .An Daniel Watt ,
 .An Walter Deignan ,
 .An Ryan Gabrys ,
@@ -360,4 +360,4 @@
 .An Ram Vedam
 (cd9660 support),
 .An UCHIYAMA Yasushi
-(v7fs support)
+(v7fs support).

Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.29 src/usr.sbin/makefs/makefs.c:1.30
--- src/usr.sbin/makefs/makefs.c:1.29	Mon Jul 18 22:52:37 2011
+++ src/usr.sbin/makefs/makefs.c	Mon Aug 15 14:45:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.29 2011/07/18 22:52:37 tron Exp $	*/
+/*	$NetBSD: makefs.c,v 1.30 2011/08/15 14:45:01 wiz Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: makefs.c,v 1.29 2011/07/18 22:52:37 tron Exp $");
+__RCSID("$NetBSD: makefs.c,v 1.30 2011/08/15 14:45:01 wiz Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -316,10 +316,10 @@
 
 	prog = getprogname();
 	fprintf(stderr,
-"usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"
-"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n"
-"\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-x]\n"
-"\t[-N userdb-dir] image-file directory\n",
+"usage: %s [-x] [-B endian] [-b free-blocks] [-d debug-mask]\n"
+"\t[-F mtree-specfile] [-f free-files] [-M minimum-size]\n"
+"\t[-m maximum-size] [-N userdb-dir] [-o fs-options] [-S sector-size]\n"
+"\t[-s image-size] [-t fs-type] image-file directory\n",
 	prog);
 	exit(1);
 }



CVS commit: src/usr.sbin/chroot

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 14:43:17 UTC 2011

Modified Files:
src/usr.sbin/chroot: chroot.8 chroot.c

Log Message:
Re-order and synchronize options listed in manpage (`SYNOPSIS' and
text) as well as `usage'-line; several punctuation improvements.
>From Snader_LB.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/chroot/chroot.8
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/chroot/chroot.c

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

Modified files:

Index: src/usr.sbin/chroot/chroot.8
diff -u src/usr.sbin/chroot/chroot.8:1.13 src/usr.sbin/chroot/chroot.8:1.14
--- src/usr.sbin/chroot/chroot.8:1.13	Tue Jul  6 23:05:56 2010
+++ src/usr.sbin/chroot/chroot.8	Mon Aug 15 14:43:17 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: chroot.8,v 1.13 2010/07/06 23:05:56 jruoho Exp $
+.\"	$NetBSD: chroot.8,v 1.14 2011/08/15 14:43:17 wiz Exp $
 .\"
 .\" Copyright (c) 1988, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" from: @(#)chroot.8	8.1 (Berkeley) 6/9/93
 .\"
-.Dd July 7, 2010
+.Dd August 13, 2011
 .Dt CHROOT 8
 .Os
 .Sh NAME
@@ -37,9 +37,9 @@
 .Nd change root directory
 .Sh SYNOPSIS
 .Nm
-.Op Fl u Ar user
-.Op Fl g Ar group
 .Op Fl G Ar group,group,...
+.Op Fl g Ar group
+.Op Fl u Ar user
 .Ar newroot
 .Op Ar command
 .Sh DESCRIPTION
@@ -49,23 +49,23 @@
 .Ar newroot
 and exec's
 .Ar command ,
-if supplied, or an interactive copy of your shell.
+or, if not supplied, an interactive copy of your shell.
 .Pp
 If the
 .Fl u ,
-.Fl g
+.Fl g ,
 or
 .Fl G
-options are given, the user, group and group list of the process are
-set to these values after the chroot has taken place.  See
+options are given, the user, group, and group list of the process are
+set to these values after the chroot has taken place; see
 .Xr setgid 2 ,
 .Xr setgroups 2 ,
 .Xr setuid 2 ,
-.Xr getgrnam 3
+.Xr getgrnam 3 ,
 and
 .Xr getpwnam 3 .
 .Pp
-Note,
+Note:
 .Ar command
 or the shell are run as your real-user-id.
 .Sh ENVIRONMENT

Index: src/usr.sbin/chroot/chroot.c
diff -u src/usr.sbin/chroot/chroot.c:1.15 src/usr.sbin/chroot/chroot.c:1.16
--- src/usr.sbin/chroot/chroot.c:1.15	Mon Jul 21 13:36:57 2008
+++ src/usr.sbin/chroot/chroot.c	Mon Aug 15 14:43:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: chroot.c,v 1.15 2008/07/21 13:36:57 lukem Exp $	*/
+/*	$NetBSD: chroot.c,v 1.16 2011/08/15 14:43:17 wiz Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)chroot.c	8.1 (Berkeley) 6/9/93";
 #else
-__RCSID("$NetBSD: chroot.c,v 1.15 2008/07/21 13:36:57 lukem Exp $");
+__RCSID("$NetBSD: chroot.c,v 1.16 2011/08/15 14:43:17 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -179,7 +179,7 @@
 usage(void)
 {
 
-	(void)fprintf(stderr, "usage: chroot [-g group] [-G group,group,...] "
+	(void)fprintf(stderr, "usage: chroot [-G group,group,...] [-g group] "
 	"[-u user] newroot [command]\n");
 	exit(1);
 }



CVS commit: src/usr.sbin/usbdevs

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 14:31:58 UTC 2011

Modified Files:
src/usr.sbin/usbdevs: usbdevs.c

Log Message:
Sync usage with SYNOPSIS.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/usbdevs/usbdevs.c

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

Modified files:

Index: src/usr.sbin/usbdevs/usbdevs.c
diff -u src/usr.sbin/usbdevs/usbdevs.c:1.26 src/usr.sbin/usbdevs/usbdevs.c:1.27
--- src/usr.sbin/usbdevs/usbdevs.c:1.26	Tue Feb  2 16:25:30 2010
+++ src/usr.sbin/usbdevs/usbdevs.c	Mon Aug 15 14:31:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdevs.c,v 1.26 2010/02/02 16:25:30 drochner Exp $	*/
+/*	$NetBSD: usbdevs.c,v 1.27 2011/08/15 14:31:58 wiz Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 usage()
 {
 
-	fprintf(stderr, "usage: %s [-a addr] [-d] [-f dev] [-v]\n",
+	fprintf(stderr, "usage: %s [-dv] [-a addr] [-f dev]\n",
 	getprogname());
 	exit(1);
 }



CVS commit: src/usr.sbin/usbdevs

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 14:31:24 UTC 2011

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

Log Message:
Sort options in SYNOPSIS. From Snader_LB.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/usbdevs/usbdevs.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/usbdevs/usbdevs.8
diff -u src/usr.sbin/usbdevs/usbdevs.8:1.8 src/usr.sbin/usbdevs/usbdevs.8:1.9
--- src/usr.sbin/usbdevs/usbdevs.8:1.8	Mon Aug 15 14:20:08 2011
+++ src/usr.sbin/usbdevs/usbdevs.8	Mon Aug 15 14:31:24 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: usbdevs.8,v 1.8 2011/08/15 14:20:08 tnn Exp $
+.\" $NetBSD: usbdevs.8,v 1.9 2011/08/15 14:31:24 wiz Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,10 +35,9 @@
 .Nd show USB devices connected to the system
 .Sh SYNOPSIS
 .Nm
+.Op Fl dv
 .Op Fl a Ar addr
-.Op Fl d
 .Op Fl f Ar dev
-.Op Fl v
 .Sh DESCRIPTION
 .Nm
 prints a listing of all USB devices connected to the system



CVS commit: src/usr.sbin/usbdevs

2011-08-15 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Mon Aug 15 14:20:08 UTC 2011

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

Log Message:
Use proper capitalization. Reported on IRC.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/usbdevs/usbdevs.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/usbdevs/usbdevs.8
diff -u src/usr.sbin/usbdevs/usbdevs.8:1.7 src/usr.sbin/usbdevs/usbdevs.8:1.8
--- src/usr.sbin/usbdevs/usbdevs.8:1.7	Wed Apr 30 13:11:03 2008
+++ src/usr.sbin/usbdevs/usbdevs.8	Mon Aug 15 14:20:08 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: usbdevs.8,v 1.7 2008/04/30 13:11:03 martin Exp $
+.\" $NetBSD: usbdevs.8,v 1.8 2011/08/15 14:20:08 tnn Exp $
 .\"
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 15, 2000
+.Dd August 15, 2011
 .Dt USBDEVS 8
 .Os
 .Sh NAME
@@ -48,11 +48,11 @@
 The options are as follows:
 .Bl -tag -width Fl
 .It Fl a Ar addr
-only print information about the device at the given address.
+Only print information about the device at the given address.
 .It Fl d
 Show the device drivers associated with each device.
 .It Fl f Ar dev
-only print information for the given USB controller.
+Only print information for the given USB controller.
 .It Fl v
 Be verbose.
 .El



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

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 11:25:09 UTC 2011

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

Log Message:
sort -u (removing duplicate entry).


To generate a diff of this commit:
cvs rdiff -u -r1.1660 -r1.1661 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.1660 src/distrib/sets/lists/comp/mi:1.1661
--- src/distrib/sets/lists/comp/mi:1.1660	Tue Aug  9 17:58:27 2011
+++ src/distrib/sets/lists/comp/mi	Mon Aug 15 11:25:07 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1660 2011/08/09 17:58:27 jruoho Exp $
+#	$NetBSD: mi,v 1.1661 2011/08/15 11:25:07 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1297,6 +1297,49 @@
 ./usr/include/g++/ostream			comp-cxx-include	cxx
 ./usr/include/g++/ostream.h			comp-obsolete		obsolete
 ./usr/include/g++/pair.h			comp-obsolete		obsolete
+./usr/include/g++/parallel/algo.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/algobase.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/algorithm		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/algorithmfwd.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/balanced_quicksort.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/base.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/basic_iterator.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/checkers.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/compatibility.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/compiletime_settings.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/equally_split.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/features.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/find.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/find_selectors.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/for_each.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/for_each_selectors.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/iterator.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/list_partition.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/losertree.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/merge.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/multiseq_selection.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/multiway_merge.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/multiway_mergesort.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/numeric		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/numericfwd.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/omp_loop.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/omp_loop_static.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/par_loop.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/parallel.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/partial_sum.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/partition.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/queue.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/quicksort.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/random_number.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/random_shuffle.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/search.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/set_operations.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/settings.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/sort.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/tags.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/types.h		comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/unique_copy.h	comp-cxx-include	gcc=45,cxx
+./usr/include/g++/parallel/workstealing.h	comp-cxx-include	gcc=45,cxx
 ./usr/include/g++/parsestream.h			comp-obsolete		obsolete
 ./usr/include/g++/pfstream.h			comp-obsolete		obsolete
 ./usr/include/g++/procbuf.h			comp-obsolete		obsolete
@@ -1501,49 +1544,6 @@
 ./usr/include/g++/tr1/utility			comp-cxx-include	gcc=45,cxx
 ./usr/include/g++/tr1/wchar.h			comp-cxx-include	gcc=45,cxx
 ./usr/include/g++/tr1/wctype.h			comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/algo.h		comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/algobase.h		comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/algorithm		comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/algorithmfwd.h	comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/balanced_quicksort.h	comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/base.h		comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/basic_iterator.h	comp-cxx-include	gcc=45,cxx
-./usr/include/g++/parallel/checkers.h		comp-cxx-include	gcc=45,cxx
-./usr/includ

CVS commit: src/doc

2011-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 15 10:58:54 UTC 2011

Modified Files:
src/doc: TODO.clang

Log Message:
Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/doc/TODO.clang

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

Modified files:

Index: src/doc/TODO.clang
diff -u src/doc/TODO.clang:1.2 src/doc/TODO.clang:1.3
--- src/doc/TODO.clang:1.2	Mon Aug 15 10:09:59 2011
+++ src/doc/TODO.clang	Mon Aug 15 10:58:54 2011
@@ -1,9 +1,9 @@
-$NetBSD: TODO.clang,v 1.2 2011/08/15 10:09:59 joerg Exp $
+$NetBSD: TODO.clang,v 1.3 2011/08/15 10:58:54 wiz Exp $
 
 Hacks for the clang integration
 ---
 
-"-no-integrated-as" is src/sys/arch/amd64 and src/sys/arch/i386
+"-no-integrated-as" in src/sys/arch/amd64 and src/sys/arch/i386
 to compensate for the missing .code16 support in LLVM MC
 and slightly different encoding of the lock stubs.
 



CVS commit: src/doc

2011-08-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Aug 15 10:10:00 UTC 2011

Modified Files:
src/doc: TODO.clang

Log Message:
Update to reflect .code32 support


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/doc/TODO.clang

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

Modified files:

Index: src/doc/TODO.clang
diff -u src/doc/TODO.clang:1.1 src/doc/TODO.clang:1.2
--- src/doc/TODO.clang:1.1	Mon May 30 16:25:31 2011
+++ src/doc/TODO.clang	Mon Aug 15 10:09:59 2011
@@ -1,11 +1,11 @@
-$NetBSD: TODO.clang,v 1.1 2011/05/30 16:25:31 joerg Exp $
+$NetBSD: TODO.clang,v 1.2 2011/08/15 10:09:59 joerg Exp $
 
 Hacks for the clang integration
 ---
 
-"-no-integrated-as" is src/sys/modules, src/sys/arch/amd64,
-src/sys/arch/i386 and src/sys/arch/xen to compensate for the missing
-.code16 and .code32 support in LLVM MC.
+"-no-integrated-as" is src/sys/arch/amd64 and src/sys/arch/i386
+to compensate for the missing .code16 support in LLVM MC
+and slightly different encoding of the lock stubs.
 
 ah_regdomain.c in the kernel currently requires -Wno-error due to
 http://llvm.org/bugs/show_bug.cgi?id=10030.



CVS commit: src/external/gpl3/gcc/lib/libgcc

2011-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 15 09:19:21 UTC 2011

Modified Files:
src/external/gpl3/gcc/lib/libgcc: Makefile.inc
src/external/gpl3/gcc/lib/libgcc/libgcc: Makefile
src/external/gpl3/gcc/lib/libgcc/libgcc_eh: Makefile
src/external/gpl3/gcc/lib/libgcc/libgcc_s: Makefile
src/external/gpl3/gcc/lib/libgcc/libgcov: Makefile

Log Message:
clean out some unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/lib/libgcc/Makefile.inc
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gcc/lib/libgcc/libgcov/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc
diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.10 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.11
--- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.10	Thu Jul  7 01:27:47 2011
+++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc	Mon Aug 15 09:19:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2011/07/07 01:27:47 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2011/08/15 09:19:21 mrg Exp $
 
 .if ${MKGCC} != "no"
 .if exists(${.CURDIR}/../arch/${MACHINE_ARCH}.mk)
@@ -28,8 +28,6 @@
 COMPILE.S=	${CC} ${AFLAGS} ${CPPFLAGS} -c
 .endif
 
-.if !defined(MKNATIVE_LIBGCC_NEW)
-
 #
 # Old style libgcc build procedure.
 #
@@ -133,14 +131,6 @@
 	${_MKTARGET_CREATE}
 	printf '#define FLOAT\n#include \n' >${.TARGET}
 
-.else	# defined(MKNATIVE_LIBGCC_NEW)
-
-#
-# New style libgcc build procedure.
-#
-
-.endif	# defined(MKNATIVE_LIBGCC_NEW)
-
 #
 # Common rules.
 #

Index: src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.3 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.4
--- src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.3	Sun Jul 10 02:39:57 2011
+++ src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile	Mon Aug 15 09:19:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/07/10 02:39:57 mrg Exp $
+#	$NetBSD: Makefile,v 1.4 2011/08/15 09:19:21 mrg Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -11,8 +11,6 @@
 
 .cc: # disable .cc->NULL transform
 
-.if !defined(MKNATIVE_LIBGCC_NEW)
-
 # XXX handle this better?
 .if ${MACHINE} == "emips"
 G_LIB2ADD_HACK+=	${GNUHOSTDIST}/gcc/config/floatunsidf.c \
@@ -35,23 +33,8 @@
 .endfor
 .   endif
 
-.else	# defined(MKNATIVE_LIBGCC_NEW)
-
-.include "../Makefile.srcs"
-
-# New style.
-TMPLSRCS=	${TMPLSRCS.libgcc.a}
-TMPLFPSRCS=	${TMPLFPSRCS.libgcc.a}
-TMPLASMSRCS=	${TMPLASMSRCS.libgcc.a}
-SRCS=		${SRCS.libgcc.a}
-
-.include "../Makefile.wrapper"
-
-.endif	# defined(MKNATIVE_LIBGCC_NEW)
-
 .include 
 
-.if !defined(MKNATIVE_LIBGCC_NEW)
 
 CLEANFILES+=	${SOBJS:=.tmp1} ${SOBJS:=.tmp2}
 
@@ -83,8 +66,6 @@
 .endif
 	rm -f ${.TARGET}.tmp1
 
-.endif	# !defined(MKNATIVE_LIBGCC_NEW)
-
 .else
 .include  # do nothing
 .endif

Index: src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile:1.1 src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile:1.2
--- src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile:1.1	Tue Jun 21 06:02:26 2011
+++ src/external/gpl3/gcc/lib/libgcc/libgcc_eh/Makefile	Mon Aug 15 09:19:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/06/21 06:02:26 mrg Exp $
+#	$NetBSD: Makefile,v 1.2 2011/08/15 09:19:21 mrg Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
@@ -11,25 +11,9 @@
 
 .cc: # disable .cc->NULL transform
 
-.if !defined(MKNATIVE_LIBGCC_NEW)
-
 SRCS+=		${LIB2_EH}
 COPTS.unwind-dw2.c = -Wno-stack-protector
 
-.else	# defined(MKNATIVE_LIBGCC_NEW)
-
-.include "../Makefile.srcs"
-
-# New style.
-TMPLSRCS=	${TMPLSRCS.libgcc_eh.a}
-TMPLFPSRCS=	${TMPLFPSRCS.libgcc_eh.a}
-TMPLASMSRCS=	${TMPLASMSRCS.libgcc_eh.a}
-SRCS=		${SRCS.libgcc_eh.a}
-
-.include "../Makefile.wrapper"
-
-.endif	# defined(MKNATIVE_LIBGCC_NEW)
-
 .include 
 
 .else

Index: src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile
diff -u src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile:1.2 src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile:1.3
--- src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile:1.2	Sun Jul 10 02:39:57 2011
+++ src/external/gpl3/gcc/lib/libgcc/libgcc_s/Makefile	Mon Aug 15 09:19:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/07/10 02:39:57 mrg Exp $
+#	$NetBSD: Makefile,v 1.3 2011/08/15 09:19:21 mrg Exp $
 
 USE_SHLIBDIR=	yes
 REQUIRETOOLS=	yes
@@ -21,8 +21,6 @@
 LDFLAGS+=	-nodefaultlibs
 LDFLAGS+=	-Wl,--version-script=${.OBJDIR}/libgcc.map
 
-.if !defined(MKNATIVE_LIBGCC_NEW)
-
 # XXX handle this better?
 .if ${MACHINE_CPU} == "mips" && !(${MKSOFTFLOAT} != "no")
 G_LIB2ADD+=	${GNUHOSTDIST}/gcc/config/floatunsidf.c \
@@ -32,20 +30,6 @@
 SRCS