CVS commit: src/common/lib/libc/arch/arm/gen

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 07:33:54 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/gen: divsi3.S udivsi3.S

Log Message:
Remove movw/movt due to linker problems.
Check for 0 divisor and __aeabi_idiv0 if needed (EABI  _LIBC only).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/arm/gen/divsi3.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/arm/gen/udivsi3.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/gen/divsi3.S
diff -u src/common/lib/libc/arch/arm/gen/divsi3.S:1.11 src/common/lib/libc/arch/arm/gen/divsi3.S:1.12
--- src/common/lib/libc/arch/arm/gen/divsi3.S:1.11	Mon Sep  9 00:34:10 2013
+++ src/common/lib/libc/arch/arm/gen/divsi3.S	Mon Sep  9 07:33:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: divsi3.S,v 1.11 2013/09/09 00:34:10 matt Exp $	*/
+/*	$NetBSD: divsi3.S,v 1.12 2013/09/09 07:33:54 matt Exp $	*/
 
 /*
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@@ -31,35 +31,39 @@ ENTRY(__divsi3)
 # endif
 	RET
 #elif defined(__ARM_EABI__)  defined(_LIBC)
-#ifdef _ARM_ARCH_7
-	movw	r2, #:lower16:REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-	movt	r2, #:upper16:REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-#else
+	cmp	r1, #0		@ dividing by 0?
+	beq	.Ldiv0		@ call __aeabi_idiv0
 	ldr	r2, .Lhwdiv_present
-#endif
 # ifdef PIC
-	add	r2, r2, pc
+	add	r2, r2, pc	@ pc = .LPIC0
 # endif
 	ldr	r2, [r2]
 .LPIC0:	cmp	r2, #0
 	beq	__divide
 	mov	r3, r0
-#if defined(__ARM_ARCH_EXT_IDIV__)
+# if defined(__ARM_ARCH_EXT_IDIV__)
 	sdiv	r0, r0, r1
-	mls	r1, r0, r1, r3	/* return modulus in r1 */
-#elif defined(__thumb__)  defined(_ARM_ARCH_T2)
+	mls	r1, r0, r1, r3	@ return modulus in r1
+# elif defined(__thumb__)  defined(_ARM_ARCH_T2)
 	.inst.w	0xfb90f0f1
 	.inst.w	0xfb003111
-#else
+# else
 	.inst	0xe710f110
 	.inst	0xe0613190
-#endif
+# endif
 	RET
-#ifndef _ARM_ARCH_7
+
 	.align	0
 .Lhwdiv_present:
 	.word	REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-#endif
+
+	.align	0
+.Ldiv0:	push	{r0, lr}	/* save r0 */
+	cmp	r0, #0
+	mvnge	r0, #0x8000	/* INT_MAX = 0x7fff */
+	movlt	r0, #0x8000	/* INT_MIN = 0x8000 */
+	bl	_C_LABEL(__aeabi_idiv0)
+	pop	{r1, pc}	/* restore r0 as r1 */
 #else /* !__ARM_EABI__ */
 	b	__divide
 #endif

Index: src/common/lib/libc/arch/arm/gen/udivsi3.S
diff -u src/common/lib/libc/arch/arm/gen/udivsi3.S:1.7 src/common/lib/libc/arch/arm/gen/udivsi3.S:1.8
--- src/common/lib/libc/arch/arm/gen/udivsi3.S:1.7	Mon Sep  9 00:34:10 2013
+++ src/common/lib/libc/arch/arm/gen/udivsi3.S	Mon Sep  9 07:33:54 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: udivsi3.S,v 1.7 2013/09/09 00:34:10 matt Exp $	*/
+/*	$NetBSD: udivsi3.S,v 1.8 2013/09/09 07:33:54 matt Exp $	*/
 
 /*
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@@ -31,35 +31,38 @@ ENTRY(__udivsi3)
 # endif
 	RET
 #elif defined(__ARM_EABI__)  defined(_LIBC)
-#ifdef _ARM_ARCH_7
-	movw	r2, #:lower16:REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-	movt	r2, #:upper16:REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-#else
+	cmp	r1, #0
+	beq	.Ldiv0
 	ldr	r2, .Lhwdiv_present
-#endif
-#ifdef PIC
-	add	r2, r2, pc
-#endif
+# ifdef PIC
+	add	r2, r2, pc	/* pc = .LPIC0 */
+# endif
 	ldr	r2, [r2]
 .LPIC0:	cmp	r2, #0
 	beq	__udivide
 	mov	r3, r0
-#if defined(__ARM_ARCH_EXT_IDIV__)
+# if defined(__ARM_ARCH_EXT_IDIV__)
 	udiv	r0, r0, r1
 	mls	r1, r0, r1, r3	/* return modulus in r1 */
-#elif defined(__thumb__)  defined(_ARM_ARCH_T2)
+# elif defined(__thumb__)  defined(_ARM_ARCH_T2)
 	.inst.w 0xfbb0f0f1
 	.inst.w	0xfb003111
-#else
+# else
 	.inst	0xe730f110
 	.inst	0xe0613190
-#endif
+# endif
 	RET
-#ifndef _ARM_ARCH_7
+
 	.align 0
 .Lhwdiv_present:
 	.word	REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-#endif
+
+	/* Handle divide by zero */
+	.align	0
+.Ldiv0:	push	{r0, lr}	/* save r0 */
+	mvns	r0, #0		/* thumb2 */
+	bl	_C_LABEL(__aeabi_idiv0)
+	pop	{r1, pc}	/* restore r0 as r1 */
 #else
 	b	__udivide
 #endif



CVS commit: src/share/man/man4

2013-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  9 08:23:54 UTC 2013

Modified Files:
src/share/man/man4: mpl115a.4

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/mpl115a.4

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

Modified files:

Index: src/share/man/man4/mpl115a.4
diff -u src/share/man/man4/mpl115a.4:1.1 src/share/man/man4/mpl115a.4:1.2
--- src/share/man/man4/mpl115a.4:1.1	Sun Sep  8 15:57:39 2013
+++ src/share/man/man4/mpl115a.4	Mon Sep  9 08:23:54 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: mpl115a.4,v 1.1 2013/09/08 15:57:39 rkujawa Exp $
+.\ $NetBSD: mpl115a.4,v 1.2 2013/09/09 08:23:54 wiz Exp $
 .\
 .\ Copyright (c) 2013 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -31,7 +31,7 @@
 .Dt MPL115A 4
 .Os
 .Sh NAME
-.Nm mpl115a 
+.Nm mpl115a
 .Nd Freescale MPL115A2 absolute pressure sensor driver
 .Sh SYNOPSIS
 .Cd mpl115a* at iic? addr 0x60



CVS commit: src/usr.bin/nl

2013-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  9 09:02:26 UTC 2013

Modified Files:
src/usr.bin/nl: nl.1

Log Message:
Improvements from jmc@openbsd.


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

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/nl/nl.1
diff -u src/usr.bin/nl/nl.1:1.13 src/usr.bin/nl/nl.1:1.14
--- src/usr.bin/nl/nl.1:1.13	Wed May  1 20:53:59 2013
+++ src/usr.bin/nl/nl.1	Mon Sep  9 09:02:25 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: nl.1,v 1.13 2013/05/01 20:53:59 christos Exp $
+.\	$NetBSD: nl.1,v 1.14 2013/09/09 09:02:25 wiz Exp $
 .\
 .\ Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -55,8 +55,8 @@ utility reads lines from the named
 or the standard input if the
 .Ar file
 argument is omitted,
-applies a configurable line numbering filter operation and writes the result
-to the standard output.
+applies a configurable line numbering filter operation,
+and writes the result to the standard output.
 .Pp
 The
 .Nm
@@ -70,14 +70,12 @@ body and footer sections.
 .Pp
 The starts of logical page sections are signaled by input lines containing
 nothing but one of the following sequences of delimiter characters:
-.Bd -unfilled -offset indent
-.Bl -column \e:\e:\e:  header 
-.It Em Line	Start of
+.Bl -column \e:\e:\e:  header  -offset indent
+.It Em Line Ta Em Start of
 .It \e:\e:\e:	header
 .It \e:\e:	body
 .It \e:	footer
 .El
-.Ed
 .Pp
 If the input does not contain any logical page section signaling directives,
 the text being read is assumed to consist of a single logical page body.
@@ -155,7 +153,8 @@ Specify the line numbering output format
 Recognized
 .Ar format
 arguments are:
-.Bl -tag -width lnXX -compact
+.Pp
+.Bl -tag -width lnXX -compact -offset indent
 .It ln
 Left justified.
 .It rn
@@ -185,7 +184,7 @@ The default
 value is 1.
 .It Fl w Ar width
 Specify the number of characters to be occupied by the line number;
-in case the
+if the
 .Ar width
 is insufficient to hold the line number, it will be truncated to its
 .Ar width



CVS commit: src/lib/libc/stdlib

2013-09-09 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Mon Sep  9 10:21:28 UTC 2013

Modified Files:
src/lib/libc/stdlib: _env.c

Log Message:
Don't scrub the environment unless we are going to change it. This should
prevent crashes in applications which carefully and manually construct
a temporary environment and later restore the original environment
like Emacs 24.

Problem reported by Thomas Klausner on pkgsrc-users mailing list.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/_env.c

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

Modified files:

Index: src/lib/libc/stdlib/_env.c
diff -u src/lib/libc/stdlib/_env.c:1.7 src/lib/libc/stdlib/_env.c:1.8
--- src/lib/libc/stdlib/_env.c:1.7	Mon Aug 19 22:14:37 2013
+++ src/lib/libc/stdlib/_env.c	Mon Sep  9 10:21:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: _env.c,v 1.7 2013/08/19 22:14:37 matt Exp $ */
+/*	$NetBSD: _env.c,v 1.8 2013/09/09 10:21:28 tron Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: _env.c,v 1.7 2013/08/19 22:14:37 matt Exp $);
+__RCSID($NetBSD: _env.c,v 1.8 2013/09/09 10:21:28 tron Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -256,10 +256,6 @@ __getenvslot(const char *name, size_t l_
 	size_t new_size, num_entries, required_size;
 	char **new_environ;
 
-	/* Does the environ need scrubbing? */
-	if (environ != allocated_environ  allocated_environ != NULL)
-		__scrubenv();
-
 	/* Search for an existing environment variable of the given name. */
 	num_entries = 0;
 	while (environ[num_entries] != NULL) {
@@ -275,6 +271,10 @@ __getenvslot(const char *name, size_t l_
 	if (!allocate)
 		return -1;
 
+	/* Does the environ need scrubbing? */
+	if (environ != allocated_environ  allocated_environ != NULL)
+		__scrubenv();
+
 	/* Create a new slot in the environment. */
 	required_size = num_entries + 1;
 	if (environ == allocated_environ 



CVS commit: src/distrib/sets

2013-09-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Sep  9 13:04:58 UTC 2013

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

Log Message:
Add conditional entry for lld.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/distrib/sets/sets.subr
cvs rdiff -u -r1.1834 -r1.1835 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/sets.subr
diff -u src/distrib/sets/sets.subr:1.151 src/distrib/sets/sets.subr:1.152
--- src/distrib/sets/sets.subr:1.151	Wed Jun 12 21:35:29 2013
+++ src/distrib/sets/sets.subr	Mon Sep  9 13:04:57 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.151 2013/06/12 21:35:29 mrg Exp $
+#	$NetBSD: sets.subr,v 1.152 2013/09/09 13:04:57 joerg Exp $
 #
 
 #
@@ -179,7 +179,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-# 	# $NetBSD: sets.subr,v 1.151 2013/06/12 21:35:29 mrg Exp $
+# 	# $NetBSD: sets.subr,v 1.152 2013/09/09 13:04:57 joerg Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -230,6 +230,7 @@ SUBST=${SUBST};s#@MACHINE@#${MACHINE}#g
 #	lint			${MKLINT} != no
 #	libcxx			${MKLIBCXX} != no
 #	libstdcxx		${MKLIBSTDCXX} != no
+#	lld			${MKLLD} != no
 #	llvm			${MKLLVM} != no
 #	lvm			${MKLVM} != no
 #	makemandb		${MKMAKEMANDB} != no

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1834 src/distrib/sets/lists/comp/mi:1.1835
--- src/distrib/sets/lists/comp/mi:1.1834	Tue Aug 20 18:05:03 2013
+++ src/distrib/sets/lists/comp/mi	Mon Sep  9 13:04:57 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1834 2013/08/20 18:05:03 matt Exp $
+#	$NetBSD: mi,v 1.1835 2013/09/09 13:04:57 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -50,6 +50,7 @@
 ./usr/bin/ld.mcldcomp-c-bin		mclinker
 ./usr/bin/lex	comp-c-bin
 ./usr/bin/lint	comp-c-bin
+./usr/bin/lld	comp-c-bin		lld
 ./usr/bin/llvm-tblgencomp-c-bin		llvm
 ./usr/bin/lordercomp-util-bin
 ./usr/bin/luac	comp-util-bin



CVS commit: src/usr.sbin/postinstall

2013-09-09 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Mon Sep  9 15:04:12 UTC 2013

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Add pkgpath.conf to /etc/defaults check.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/usr.sbin/postinstall/postinstall

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/postinstall/postinstall
diff -u src/usr.sbin/postinstall/postinstall:1.157 src/usr.sbin/postinstall/postinstall:1.158
--- src/usr.sbin/postinstall/postinstall:1.157	Sun Jul 14 15:44:00 2013
+++ src/usr.sbin/postinstall/postinstall	Mon Sep  9 15:04:12 2013
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.157 2013/07/14 15:44:00 htodd Exp $
+# $NetBSD: postinstall,v 1.158 2013/09/09 15:04:12 prlw1 Exp $
 #
 # Copyright (c) 2002-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -762,7 +762,7 @@ do_defaults()
 
 	compare_dir $op ${SRC_DIR}/etc/defaults ${DEST_DIR}/etc/defaults \
 		444 \
-		daily.conf monthly.conf security.conf \
+		daily.conf monthly.conf pkgpath.conf security.conf \
 		weekly.conf ${extra_scripts}
 	failed=$(( ${failed} + $? ))
 



CVS commit: src/sys/arch/evbarm/cubie

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:54:38 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Cleanup.  Make KGDB work.
We now process the u-boot boot args.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/cubie/cubie_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/evbarm/cubie/cubie_machdep.c
diff -u src/sys/arch/evbarm/cubie/cubie_machdep.c:1.7 src/sys/arch/evbarm/cubie/cubie_machdep.c:1.8
--- src/sys/arch/evbarm/cubie/cubie_machdep.c:1.7	Sun Sep  8 04:06:44 2013
+++ src/sys/arch/evbarm/cubie/cubie_machdep.c	Mon Sep  9 17:54:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cubie_machdep.c,v 1.7 2013/09/08 04:06:44 matt Exp $ */
+/*	$NetBSD: cubie_machdep.c,v 1.8 2013/09/09 17:54:38 matt Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.7 2013/09/08 04:06:44 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: cubie_machdep.c,v 1.8 2013/09/09 17:54:38 matt Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -192,29 +192,32 @@ static char bootargs[MAX_BOOT_STRING];
 char *boot_args = NULL;
 char *boot_file = NULL;
 
-u_int uboot_args[4] = { 0 };	/* filled in by cubie_start.S (not in bss) */
+/*
+ * uboot_args are filled in by cubie_start.S and must be in .data
+ * and not .bbs since .bss is cleared after uboot_args are filled in.
+ */
+uintptr_t uboot_args[4] = { 0 };
 
 /* Same things, but for the free (unused by the kernel) memory. */
 
-extern char KERNEL_BASE_phys[];
-extern char _end[];
+extern char KERNEL_BASE_phys[];	/* physical start of kernel */
+extern char _end[];		/* physical end of kernel */
 
+#if NAWIN_FB  0
 #if NCOM  0
 int use_fb_console = false;
 #else
 int use_fb_console = true;
 #endif
-
-#ifdef CPU_CORTEXA7
-uint32_t arm_cnt_frq;
 #endif
 
 /*
  * Macros to translate between physical and virtual for a subset of the
  * kernel address space.  *Not* for general use.
  */
-#define KERNEL_BASE_PHYS ((paddr_t)KERNEL_BASE_phys)
-#define	AWIN_CORE_VOFFSET	(AWIN_CORE_VBASE - AWIN_CORE_PBASE)
+#define KERNEL_BASE_PHYS	((paddr_t)KERNEL_BASE_phys)
+#define KERNEL_PHYS_VOFFSET	(KERNEL_BASE - AWIN_SDRAM_PBASE)
+#define AWIN_CORE_VOFFSET	(AWIN_CORE_VBASE - AWIN_CORE_PBASE)
 
 /* Prototypes */
 
@@ -223,11 +226,8 @@ void consinit(void);
 static void kgdb_port_init(void);
 #endif
 
-static void init_clocks(void);
 static void cubie_device_register(device_t, void *);
 
-bs_protos(bs_notimpl);
-
 #if NCOM  0
 #include dev/ic/comreg.h
 #include dev/ic/comvar.h
@@ -248,8 +248,8 @@ bs_protos(bs_notimpl);
  * using the 2nd page tables.
  */
 
-#define	_A(a)	((a)  ~L1_S_OFFSET)
-#define	_S(s)	(((s) + L1_S_SIZE - 1)  ~(L1_S_SIZE-1))
+#define _A(a)	((a)  ~L1_S_OFFSET)
+#define _S(s)	(((s) + L1_S_SIZE - 1)  ~(L1_S_SIZE-1))
 
 static const struct pmap_devmap devmap[] = {
 	{
@@ -295,9 +295,6 @@ static const struct pmap_devmap devmap[]
 u_int
 initarm(void *arg)
 {
-	psize_t ram_size = 0;
-	char *ptr;
-
 	pmap_devmap_register(devmap);
 	awin_bootstrap(AWIN_CORE_VBASE, CONADDR_VA);
 
@@ -305,13 +302,13 @@ initarm(void *arg)
 	if (set_cpufuncs())
 		panic(cpu not recognized!);
 
-	init_clocks();
-
 	/* The console is going to try to map things.  Give pmap a devmap. */
 	consinit();
 
+#ifdef VERBOSE_INIT_ARM
 	printf(\nuboot arg = %#x, %#x, %#x, %#x\n,
 	uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]);
+#endif
 
 #ifdef KGDB
 	kgdb_port_init();
@@ -331,17 +328,17 @@ initarm(void *arg)
 
 #ifdef VERBOSE_INIT_ARM
 	printf(initarm: Configuring system ...\n);
-#endif
 
 #if defined(CPU_CORTEXA7) || defined(CPU_CORTEXA9) || defined(CPU_CORTEXA15)
 	printf(initarm: cbar=%#x\n, armreg_cbar_read());
 #endif
+#endif
 
 	/*
 	 * Set up the variables that define the availability of physical
 	 * memory.
 	 */
-	ram_size = awin_memprobe();
+	psize_t ram_size = awin_memprobe();
 
 	/*
 	 * If MEMSIZE specified less than what we really have, limit ourselves
@@ -356,7 +353,7 @@ initarm(void *arg)
 
 	/* Fake bootconfig structure for the benefit of pmap.c. */
 	bootconfig.dramblocks = 1;
-	bootconfig.dram[0].address = KERNEL_BASE_PHYS  -0x40;
+	bootconfig.dram[0].address = AWIN_SDRAM_PBASE;
 	bootconfig.dram[0].pages = ram_size / PAGE_SIZE;
 
 #ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
@@ -367,43 +364,45 @@ initarm(void *arg)
 #endif
 	KASSERT((armreg_pfr1_read()  ARM_PFR1_SEC_MASK) != 0);
 
-#if 0
-	/* bootargs env variable is passed as 4th argument to kernel */
-	printf(Copy bootargs);
-	if (uboot_args[3] - AWIN_SDRAM_PBASE  ram_size) {
-		strlcpy(bootargs, (char *)uboot_args[3], sizeof(bootargs));
-	}
-	printf(\n);
-#endif
-
 	arm32_bootmem_init(bootconfig.dram[0].address, ram_size,
 	KERNEL_BASE_PHYS);
 	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_LOW, 0, devmap,
 	

CVS commit: src/sys/arch/arm/allwinner

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:52:48 UTC 2013

Modified Files:
src/sys/arch/arm/allwinner: awin_reg.h

Log Message:
Add AWIN_AHCI_DMA
Do a little cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/allwinner/awin_reg.h

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.8 src/sys/arch/arm/allwinner/awin_reg.h:1.9
--- src/sys/arch/arm/allwinner/awin_reg.h:1.8	Sun Sep  8 01:29:42 2013
+++ src/sys/arch/arm/allwinner/awin_reg.h	Mon Sep  9 17:52:48 2013
@@ -371,7 +371,8 @@
 #define AWIN_EMAC_SAFX3_L_REG		0x00BC
 #define AWIN_EMAC_SAFX3_H_REG		0x00C0
 
-#define AWIN_ACHI_BISTAFR_REG		0x00A0
+#define AWIN_AHCI_DMA_REG		0x0070
+#define AWIN_AHCI_BISTAFR_REG		0x00A0
 #define AWIN_AHCI_BISTCR_REG		0x00A4
 #define AWIN_AHCI_BISTFCTR_REG		0x00A8
 #define AWIN_AHCI_BISTSR_REG		0x00AC
@@ -471,17 +472,22 @@
 
 #define AWIN_PLL_CFG_ENABLE		__BIT(31)
 #define AWIN_PLL_CFG_BYPASS		__BIT(30)
-#define AWIN_PLL5_CFG_DDR_CLK_EN	__BIT(29)
 #define AWIN_PLL_CFG_EXG_MODE		__BIT(25)
 #define AWIN_PLL_CFG_OUT_EXP_DIVP	__BITS(17,16)
-#define AWIN_PLL6_CFG_SATA_CLK_EN	__BIT(14)
 #define AWIN_PLL_CFG_FACTOR_N		__BITS(12,8)
-#define AWIN_PLL5_CFG_LDO_EN		__BIT(7)
 #define AWIN_PLL_CFG_FACTOR_K		__BITS(5,4)
-#define AWIN_PLL5_CFG_FACTOR_M1		__BITS(3,2)
+#define AWIN_PLL_CFG_FACTOR_M		__BITS(1,0)
+
 #define AWIN_PLL1_SIG_DELT_PAT_IN	__BIT(3)
 #define AWIN_PLL1_SIG_DELT_PAT_EN	__BIT(2)
-#define AWIN_PLL_CFG_FACTOR_M		__BITS(1,0)
+
+#define AWIN_PLL5_CFG_DDR_CLK_EN	__BIT(29)
+#define AWIN_PLL5_CFG_LDO_EN		__BIT(7)
+#define AWIN_PLL5_CFG_FACTOR_M1		__BITS(3,2)
+
+#define AWIN_PLL6_VCO_BIAS		__BITS(29,25)
+#define AWIN_PLL6_PLL_BIAS		__BITS(24,20)
+#define AWIN_PLL6_CFG_SATA_CLK_EN	__BIT(14)
 
 #define AWIN_CPU_CLK_SRC_SEL		__BITS(17,16)
 #define AWIN_CPU_CLK_SRC_SEL_LOSC	0



CVS commit: src/sys/arch/arm/allwinner

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:53:36 UTC 2013

Modified Files:
src/sys/arch/arm/allwinner: awin_board.c

Log Message:
Make sure AWIN_PLL_CFG_BYPASS is cleared (it was but just being safe.)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/allwinner/awin_board.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/arm/allwinner/awin_board.c
diff -u src/sys/arch/arm/allwinner/awin_board.c:1.5 src/sys/arch/arm/allwinner/awin_board.c:1.6
--- src/sys/arch/arm/allwinner/awin_board.c:1.5	Sun Sep  8 10:32:56 2013
+++ src/sys/arch/arm/allwinner/awin_board.c	Mon Sep  9 17:53:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_board.c,v 1.5 2013/09/08 10:32:56 jmcneill Exp $	*/
+/*	$NetBSD: awin_board.c,v 1.6 2013/09/09 17:53:36 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_board.c,v 1.5 2013/09/08 10:32:56 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_board.c,v 1.6 2013/09/09 17:53:36 matt Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -205,6 +205,7 @@ awin_pll6_enable(void)
 	 */
 	uint32_t ncfg = ocfg;
 	ncfg = ~(AWIN_PLL_CFG_FACTOR_M|AWIN_PLL_CFG_FACTOR_N);
+	ncfg = ~(AWIN_PLL_CFG_BYPASS);
 	ncfg |= __SHIFTIN(k, AWIN_PLL_CFG_FACTOR_M);
 	ncfg |= __SHIFTIN(25, AWIN_PLL_CFG_FACTOR_N);
 	ncfg |= AWIN_PLL_CFG_ENABLE | AWIN_PLL6_CFG_SATA_CLK_EN;
@@ -212,4 +213,11 @@ awin_pll6_enable(void)
 		bus_space_write_4(bst, bsh,
 		AWIN_CCM_OFFSET + AWIN_PLL6_CFG_REG, ncfg);
 	}
+#if 0
+	printf( [pll6=%#x-%#x:n=%ju k=%ju m=%ju] ,
+	ocfg, ncfg,
+	__SHIFTOUT(ncfg, AWIN_PLL_CFG_FACTOR_N),
+	__SHIFTOUT(ncfg, AWIN_PLL_CFG_FACTOR_K),
+	__SHIFTOUT(ncfg, AWIN_PLL_CFG_FACTOR_M));
+#endif
 }



CVS commit: src/usr.bin/w

2013-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  9 19:20:38 UTC 2013

Modified Files:
src/usr.bin/w: w.c

Log Message:
Expand ep-host to contain the final string that we are going to print
before computing the width of the host column.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/w/w.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/w/w.c
diff -u src/usr.bin/w/w.c:1.76 src/usr.bin/w/w.c:1.77
--- src/usr.bin/w/w.c:1.76	Thu Oct 20 22:26:09 2011
+++ src/usr.bin/w/w.c	Mon Sep  9 15:20:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: w.c,v 1.76 2011/10/21 02:26:09 christos Exp $	*/
+/*	$NetBSD: w.c,v 1.77 2013/09/09 19:20:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)w.c	8.6 (Berkeley) 6/30/94;
 #else
-__RCSID($NetBSD: w.c,v 1.76 2011/10/21 02:26:09 christos Exp $);
+__RCSID($NetBSD: w.c,v 1.77 2013/09/09 19:20:38 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -126,17 +126,16 @@ static int	proc_compare_wrapper(const st
 static int	ttystat(const char *, struct stat *);
 static void	process(struct entry *);
 #endif
+static void	fixhost(struct entry *ep);
 __dead static void	usage(int);
 
 int
 main(int argc, char **argv)
 {
 	struct kinfo_proc2 *kp;
-	struct hostent *hp;
-	struct in_addr l;
 	struct entry *ep;
 	int ch, i, nentries, nusers, wcmd, curtain, use_sysctl;
-	char *memf, *nlistf, *p, *x, *usrnp;
+	char *memf, *nlistf, *usrnp;
 	const char *options;
 	time_t then;
 	size_t len;
@@ -147,7 +146,7 @@ main(int argc, char **argv)
 	struct utmpx *utx;
 #endif
 	const char *progname;
-	char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
+	char errbuf[_POSIX2_LINE_MAX];
 
 	setprogname(argv[0]);
 
@@ -239,6 +238,7 @@ main(int argc, char **argv)
 			sizeof(utx-ut_host));
 			ep-host[sizeof(utx-ut_host)] = '\0';
 		}
+		fixhost(ep);
 		ep-type[0] = 'x';
 		ep-tv = utx-ut_tv;
 		ep-pid = utx-ut_pid;
@@ -276,6 +276,7 @@ main(int argc, char **argv)
 		ep-name[sizeof(ut-ut_name)] = '\0';
 		ep-line[sizeof(ut-ut_line)] = '\0';
 		ep-host[sizeof(ut-ut_host)] = '\0';
+		fixhost(ep);
 		ep-tv.tv_sec = ut-ut_time;
 		*nextp = ep;
 		nextp = (ep-next);
@@ -378,6 +379,7 @@ main(int argc, char **argv)
 
 	if (!nflag) {
 		int	rv;
+		char	*p;
 
 		rv = gethostname(domain, sizeof(domain));
 		domain[sizeof(domain) - 1] = '\0';
@@ -388,36 +390,6 @@ main(int argc, char **argv)
 	}
 
 	for (ep = ehead; ep != NULL; ep = ep-next) {
-		char host_buf[MAXHOSTNAMELEN + 1];
-
-		strlcpy(host_buf, *ep-host ? ep-host : -, sizeof(host_buf));
-		p = host_buf;
-
-		for (x = p; x  p + MAXHOSTNAMELEN; x++)
-			if (*x == '\0' || *x == ':')
-break;
-		if (x == p + MAXHOSTNAMELEN || *x != ':')
-			x = NULL;
-		else
-			*x++ = '\0';
-
-		if (!nflag  inet_aton(p, l) 
-		(hp = gethostbyaddr((char *)l, sizeof(l), AF_INET))) {
-			if (domain[0] != '\0') {
-p = hp-h_name;
-p += strlen(hp-h_name);
-p -= strlen(domain);
-if (p  hp-h_name 
-strcasecmp(p, domain) == 0)
-	*p = '\0';
-			}
-			p = hp-h_name;
-		}
-		if (x) {
-			(void)snprintf(buf, sizeof(buf), %s:%s, p, x);
-			p = buf;
-		}
-
 		if (ep-tp != NULL)
 			kp = ep-tp;
 		else if (ep-pp != NULL)
@@ -434,7 +406,7 @@ main(int argc, char **argv)
 		usrnp = (kp == NULL) ? ep-name : kp-p_login;
 		(void)printf(%-*s %-7.7s %-*.*s ,
 		maxname, usrnp, ep-line,
-		maxhost, maxhost, *p ? p : -);
+		maxhost, maxhost, ep-host);
 		then = (time_t)ep-tv.tv_sec;
 		pr_attime(then, now);
 		pr_idle(ep-idle);
@@ -639,6 +611,49 @@ proc_compare_wrapper(const struct kinfo_
 }
 
 static void
+fixhost(struct entry *ep)
+{
+	char host_buf[sizeof(ep-host)];
+	char *p, *x;
+	struct hostent *hp;
+	struct in_addr l;
+
+	strlcpy(host_buf, *ep-host ? ep-host : -, sizeof(host_buf));
+	p = host_buf;
+
+	/*
+	 * XXX: Historical behavior, ':' in hostname means X display number,
+	 * IPv6 not handled.
+	 */
+	for (x = p; x  host_buf[sizeof(host_buf)]; x++)
+		if (*x == '\0' || *x == ':')
+			break;
+	if (x == p + sizeof(host_buf) || *x != ':')
+		x = NULL;
+	else
+		*x++ = '\0';
+
+	if (!nflag  inet_aton(p, l) 
+	(hp = gethostbyaddr((char *)l, sizeof(l), AF_INET))) {
+		if (domain[0] != '\0') {
+			p = hp-h_name;
+			p += strlen(hp-h_name);
+			p -= strlen(domain);
+			if (p  hp-h_name 
+			strcasecmp(p, domain) == 0)
+*p = '\0';
+		}
+		p = hp-h_name;
+	}
+
+	if (x)
+		(void)snprintf(ep-host, sizeof(ep-host), %s:%s, p, x);
+	else
+
+		strlcpy(ep-host, p, sizeof(ep-host));
+}
+
+static void
 usage(int wcmd)
 {
 



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

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:18:08 UTC 2013

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

Log Message:
Fix minor bug in previous: make sure we come out of rump_init()
without a bound lwp set.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.274 src/sys/rump/librump/rumpkern/rump.c:1.275
--- src/sys/rump/librump/rumpkern/rump.c:1.274	Sat Sep  7 17:58:00 2013
+++ src/sys/rump/librump/rumpkern/rump.c	Mon Sep  9 19:18:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.274 2013/09/07 17:58:00 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.275 2013/09/09 19:18:08 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.274 2013/09/07 17:58:00 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.275 2013/09/09 19:18:08 pooka Exp $);
 
 #include sys/systm.h
 #define ELFSIZE ARCH_ELFSIZE
@@ -546,8 +546,10 @@ rump_init(void)
 	bootlwp = NULL;
 
 	/* open 0/1/2 for init */
+	KASSERT(rump_lwproc_curlwp() == NULL);
 	rump_lwproc_switch(initlwp);
 	rump_consdev_init();
+	rump_lwproc_switch(NULL);
 
 	/* release cpu */
 	rump_unschedule();



CVS commit: src/tests/fs/common

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:47:38 UTC 2013

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Remove what looks like an outdated assert (there was something very sneaky
about this code, but my memory is fading ...)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_puffs.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/fs/common/fstest_puffs.c
diff -u src/tests/fs/common/fstest_puffs.c:1.10 src/tests/fs/common/fstest_puffs.c:1.11
--- src/tests/fs/common/fstest_puffs.c:1.10	Thu Feb 10 16:35:01 2011
+++ src/tests/fs/common/fstest_puffs.c	Mon Sep  9 19:47:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstest_puffs.c,v 1.10 2011/02/10 16:35:01 njoly Exp $	*/
+/*	$NetBSD: fstest_puffs.c,v 1.11 2013/09/09 19:47:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -386,12 +386,6 @@ puffs_fstest_mount(const atf_tc_t *tc, v
 	if (fd == -1)
 		return fd;
 
-#if 0
-	pa-pa_fd = fd;
-#else
-	assert(fd == 0); /* XXX: FIXME */
-#endif
-
 	if (rump_sys_mkdir(path, 0777) == -1)
 		return -1;
 



CVS commit: src/tests/rump/rumpnet

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:27:49 UTC 2013

Modified Files:
src/tests/rump/rumpnet: t_shmif.sh

Log Message:
Use 8 TCP/IP stacks instead of 16.  That still gives us plenty crossping
testing for 1/4th of the cost.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/rump/rumpnet/t_shmif.sh

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

Modified files:

Index: src/tests/rump/rumpnet/t_shmif.sh
diff -u src/tests/rump/rumpnet/t_shmif.sh:1.1 src/tests/rump/rumpnet/t_shmif.sh:1.2
--- src/tests/rump/rumpnet/t_shmif.sh:1.1	Thu Mar 10 14:09:46 2011
+++ src/tests/rump/rumpnet/t_shmif.sh	Mon Sep  9 19:27:49 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: t_shmif.sh,v 1.1 2011/03/10 14:09:46 pooka Exp $
+#	$NetBSD: t_shmif.sh,v 1.2 2013/09/09 19:27:49 pooka Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -27,9 +27,11 @@
 
 atf_test_case crossping cleanup
 
+NKERN=8
+
 crossping_head()
 {
-	atf_set descr start 16 rump kernels on one shmif bus and crossping
+	atf_set descr run $NKERN rump kernels on one shmif bus and crossping
 }
 
 startserver()
@@ -51,11 +53,11 @@ pingothers()
 crossping_body()
 {
 
-	for x in `jot 16` ; do startserver $x ; done
-	for x in `jot 16`
+	for x in `jot ${NKERN}` ; do startserver $x ; done
+	for x in `jot ${NKERN}`
 	do
 		export RUMP_SERVER=unix://sock${x}
-		for y in `jot 16`
+		for y in `jot ${NKERN}`
 		do
 			[ ${y} -eq ${x} ]  continue
 			atf_check -s exit:0 -o ignore -e ignore \
@@ -67,7 +69,7 @@ crossping_body()
 crossping_cleanup()
 {
 
-	for x in `jot 16` ; do RUMP_SERVER=unix://sock${x} rump.halt ; done
+	for x in `jot ${NKERN}` ; do RUMP_SERVER=unix://sock${x} rump.halt ;done
 	:
 }
 



CVS commit: src/sbin/resize_ffs

2013-09-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Sep  9 19:37:17 UTC 2013

Modified Files:
src/sbin/resize_ffs: TODO

Log Message:
Add an item to the list (SIGINFO support).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/resize_ffs/TODO

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

Modified files:

Index: src/sbin/resize_ffs/TODO
diff -u src/sbin/resize_ffs/TODO:1.8 src/sbin/resize_ffs/TODO:1.9
--- src/sbin/resize_ffs/TODO:1.8	Wed Jan  5 02:18:15 2011
+++ src/sbin/resize_ffs/TODO	Mon Sep  9 19:37:17 2013
@@ -4,3 +4,4 @@ resize_ffs(8) TODO list
 * Support shrinking UFS2 file systems
 * Make the output a bit more verbose, similar to newfs(8)
 * Expand the testing done in src/tests/sbin/resize_ffs
+* SIGINFO support



CVS commit: src/sys/net

2013-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  9 20:53:52 UTC 2013

Modified Files:
src/sys/net: bpf.c

Log Message:
PR/48198: Peter Bex: Avoid kernel panic caused by setting a very small bpf
buffer size.
XXX: Pullup -6


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/net/bpf.c

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

Modified files:

Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.175 src/sys/net/bpf.c:1.176
--- src/sys/net/bpf.c:1.175	Fri Aug 30 11:00:08 2013
+++ src/sys/net/bpf.c	Mon Sep  9 16:53:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.175 2013/08/30 15:00:08 rmind Exp $	*/
+/*	$NetBSD: bpf.c,v 1.176 2013/09/09 20:53:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.175 2013/08/30 15:00:08 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.176 2013/09/09 20:53:51 christos Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_bpf.h
@@ -1576,11 +1576,8 @@ static void
 catchpacket(struct bpf_d *d, u_char *pkt, u_int pktlen, u_int snaplen,
 void *(*cpfn)(void *, const void *, size_t), struct timespec *ts)
 {
-	struct bpf_hdr *hp;
-#ifdef _LP64
-	struct bpf_hdr32 *hp32;
-#endif
-	int totlen, curlen;
+	char *h;
+	int totlen, curlen, caplen;
 	int hdrlen = bpf_hdrlen(d);
 	int do_wakeup = 0;
 
@@ -1595,6 +1592,13 @@ catchpacket(struct bpf_d *d, u_char *pkt
 	totlen = hdrlen + min(snaplen, pktlen);
 	if (totlen  d-bd_bufsize)
 		totlen = d-bd_bufsize;
+	/*
+	 * If we adjusted totlen to fit the bufsize, it could be that
+	 * totlen is smaller than hdrlen because of the link layer header.
+	 */
+	caplen = totlen - hdrlen;
+	if (caplen  0)
+		caplen = 0;
 
 	/*
 	 * Round up the end of the previous packet to the next longword.
@@ -1635,33 +1639,34 @@ catchpacket(struct bpf_d *d, u_char *pkt
 	/*
 	 * Append the bpf header.
 	 */
+	h = (char *)d-bd_sbuf + curlen;
 #ifdef _LP64
 	if (d-bd_compat32) {
-		hp32 = (struct bpf_hdr32 *)((char *)d-bd_sbuf + curlen);
+		struct bpf_hdr32 *hp32;
+
+		hp32 = (struct bpf_hdr32 *)h;
 		hp32-bh_tstamp.tv_sec = ts-tv_sec;
 		hp32-bh_tstamp.tv_usec = ts-tv_nsec / 1000;
 		hp32-bh_datalen = pktlen;
 		hp32-bh_hdrlen = hdrlen;
-		/*
-		 * Copy the packet data into the store buffer and update its length.
-		 */
-		(*cpfn)((u_char *)hp32 + hdrlen, pkt,
-		(hp32-bh_caplen = totlen - hdrlen));
+		hp32-bh_caplen = caplen;
 	} else
 #endif
 	{
-		hp = (struct bpf_hdr *)((char *)d-bd_sbuf + curlen);
+		struct bpf_hdr *hp;
+
+		hp = (struct bpf_hdr *)h;
 		hp-bh_tstamp.tv_sec = ts-tv_sec;
 		hp-bh_tstamp.tv_usec = ts-tv_nsec / 1000;
 		hp-bh_datalen = pktlen;
 		hp-bh_hdrlen = hdrlen;
-		/*
-		 * Copy the packet data into the store buffer and update
-		 * its length.
-		 */
-		(*cpfn)((u_char *)hp + hdrlen, pkt,
-		(hp-bh_caplen = totlen - hdrlen));
+		hp-bh_caplen = caplen;
 	}
+
+	/*
+	 * Copy the packet data into the store buffer and update its length.
+	 */
+	(*cpfn)(h + hdrlen, pkt, caplen);
 	d-bd_slen = curlen + totlen;
 
 	/*



CVS commit: src/usr.sbin/mtree

2013-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  9 23:27:43 UTC 2013

Modified Files:
src/usr.sbin/mtree: compare.c create.c spec.c

Log Message:
use intmax_t instead of long long. fixes wrong cast for time_t.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/mtree/compare.c
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/mtree/create.c
cvs rdiff -u -r1.85 -r1.86 src/usr.sbin/mtree/spec.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/mtree/compare.c
diff -u src/usr.sbin/mtree/compare.c:1.55 src/usr.sbin/mtree/compare.c:1.56
--- src/usr.sbin/mtree/compare.c:1.55	Thu Oct  4 20:59:35 2012
+++ src/usr.sbin/mtree/compare.c	Mon Sep  9 19:27:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $	*/
+/*	$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)compare.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $);
+__RCSID($NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -192,9 +192,9 @@ typeerr:		LABEL;
 	(s-type == F_BLOCK || s-type == F_CHAR) 
 	s-st_rdev != p-fts_statp-st_rdev) {
 		LABEL;
-		printf(%sdevice (%#llx, %#llx,
-		tab, (long long)s-st_rdev,
-		(long long)p-fts_statp-st_rdev);
+		printf(%sdevice (%#jx, %#jx,
+		tab, (uintmax_t)s-st_rdev,
+		(uintmax_t)p-fts_statp-st_rdev);
 		if (uflag) {
 			if ((unlink(p-fts_accpath) == -1) ||
 			(mknod(p-fts_accpath,
@@ -283,9 +283,9 @@ typeerr:		LABEL;
 	}
 	if (s-flags  F_SIZE  s-st_size != p-fts_statp-st_size) {
 		LABEL;
-		printf(%ssize (%lld, %lld)\n,
-		tab, (long long)s-st_size,
-		(long long)p-fts_statp-st_size);
+		printf(%ssize (%ju, %ju)\n,
+		tab, (uintmax_t)s-st_size,
+		(uintmax_t)p-fts_statp-st_size);
 		tab = \t;
 	}
 	/*

Index: src/usr.sbin/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.69 src/usr.sbin/mtree/create.c:1.70
--- src/usr.sbin/mtree/create.c:1.69	Sun Feb  3 14:15:17 2013
+++ src/usr.sbin/mtree/create.c	Mon Sep  9 19:27:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $	*/
+/*	$NetBSD: create.c,v 1.70 2013/09/09 23:27:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = @(#)create.c	8.1 (Berkeley) 6/6/93;
 #else
-__RCSID($NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $);
+__RCSID($NetBSD: create.c,v 1.70 2013/09/09 23:27:43 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -216,22 +216,22 @@ statf(int indent, FTSENT *p)
 		p-fts_statp-st_mode  MBITS);
 	if (keys  F_DEV 
 	(S_ISBLK(p-fts_statp-st_mode) || S_ISCHR(p-fts_statp-st_mode)))
-		output(indent, offset, device=%#llx,
-		(long long)p-fts_statp-st_rdev);
+		output(indent, offset, device=%#jx,
+		(uintmax_t)p-fts_statp-st_rdev);
 	if (keys  F_NLINK  p-fts_statp-st_nlink != 1)
 		output(indent, offset, nlink=%u, p-fts_statp-st_nlink);
 	if (keys  F_SIZE 
 	(flavor != F_NETBSD6 || S_ISREG(p-fts_statp-st_mode)))
-		output(indent, offset, size=%lld,
-		(long long)p-fts_statp-st_size);
+		output(indent, offset, size=%ju,
+		(uintmax_t)p-fts_statp-st_size);
 	if (keys  F_TIME)
 #if defined(BSD4_4)  !defined(HAVE_NBTOOL_CONFIG_H)
-		output(indent, offset, time=%ld.%09ld,
-		(long)p-fts_statp-st_mtimespec.tv_sec,
+		output(indent, offset, time=%jd.%09ld,
+		(intmax_t)p-fts_statp-st_mtimespec.tv_sec,
 		p-fts_statp-st_mtimespec.tv_nsec);
 #else
-		output(indent, offset, time=%ld.%09ld,
-		(long)p-fts_statp-st_mtime, (long)0);
+		output(indent, offset, time=%jd.%09ld,
+		(intmax_t)p-fts_statp-st_mtime, (long)0);
 #endif
 	if (keys  F_CKSUM  S_ISREG(p-fts_statp-st_mode)) {
 		if ((fd = open(p-fts_accpath, O_RDONLY, 0))  0 ||

Index: src/usr.sbin/mtree/spec.c
diff -u src/usr.sbin/mtree/spec.c:1.85 src/usr.sbin/mtree/spec.c:1.86
--- src/usr.sbin/mtree/spec.c:1.85	Thu Dec 20 11:43:16 2012
+++ src/usr.sbin/mtree/spec.c	Mon Sep  9 19:27:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec.c,v 1.85 2012/12/20 16:43:16 christos Exp $	*/
+/*	$NetBSD: spec.c,v 1.86 2013/09/09 23:27:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = @(#)spec.c	8.2 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: spec.c,v 1.85 2012/12/20 16:43:16 christos Exp $);
+__RCSID($NetBSD: spec.c,v 1.86 2013/09/09 23:27:43 christos Exp $);
 #endif
 #endif /* not lint */
 
@@ -350,16 +350,18 @@ dump_nodes(const char *dir, NODE *root, 
 			appendfield(pathlast, mode=%#o, cur-st_mode);
 		if (MATCHFLAG(F_DEV) 
 		(cur-type == F_BLOCK || cur-type == F_CHAR))
-			appendfield(pathlast, device=%#llx, (long long)cur-st_rdev);
+			appendfield(pathlast, device=%#jx,
+			(uintmax_t)cur-st_rdev);
 		if 

CVS commit: src/share/man/man7

2013-09-09 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Tue Sep 10 00:41:51 UTC 2013

Modified Files:
src/share/man/man7: hier.7

Log Message:
PR/48199 - David H. Gutteridge -- remove some vestiges left over from UUCP 
removal


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/share/man/man7/hier.7

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

Modified files:

Index: src/share/man/man7/hier.7
diff -u src/share/man/man7/hier.7:1.104 src/share/man/man7/hier.7:1.105
--- src/share/man/man7/hier.7:1.104	Tue Jul  9 09:41:30 2013
+++ src/share/man/man7/hier.7	Tue Sep 10 00:41:51 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: hier.7,v 1.104 2013/07/09 09:41:30 njoly Exp $
+.\	$NetBSD: hier.7,v 1.105 2013/09/10 00:41:51 jnemeth Exp $
 .\
 .\ Copyright (c) 1990, 1993, 1994
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)hier.7	8.5 (Berkeley) 6/1/94
 .\
-.Dd February 5, 2013
+.Dd September 9, 2013
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -1174,7 +1174,7 @@ and
 .It Sy spool/
 miscellaneous printer and mail system spooling directories
 .Pp
-.Bl -tag -width uucppublic/ -compact
+.Bl -tag -width postfix/ -compact
 .It Sy ftp/
 commonly
 .Dq ~ftp ,
@@ -1192,13 +1192,6 @@ printer spooling directories
 postfix mail queue;
 see
 .Xr postfix 1
-.It Sy uucp/
-uucp spool directory
-.It Sy uucppublic/
-commonly
-.Dq ~uucp ,
-the uucp public temporary directory; see
-.Xr uucp 1
 .El
 .Pp
 .It Sy tmp/



CVS commit: src/common/lib/libc/arch/arm/gen

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 07:33:54 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/gen: divsi3.S udivsi3.S

Log Message:
Remove movw/movt due to linker problems.
Check for 0 divisor and __aeabi_idiv0 if needed (EABI  _LIBC only).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/arm/gen/divsi3.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/arm/gen/udivsi3.S

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



CVS commit: src/share/man/man4

2013-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  9 08:23:54 UTC 2013

Modified Files:
src/share/man/man4: mpl115a.4

Log Message:
Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/mpl115a.4

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



CVS commit: src/usr.bin/nl

2013-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep  9 09:02:26 UTC 2013

Modified Files:
src/usr.bin/nl: nl.1

Log Message:
Improvements from jmc@openbsd.


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

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



CVS commit: src/lib/libc/stdlib

2013-09-09 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Mon Sep  9 10:21:28 UTC 2013

Modified Files:
src/lib/libc/stdlib: _env.c

Log Message:
Don't scrub the environment unless we are going to change it. This should
prevent crashes in applications which carefully and manually construct
a temporary environment and later restore the original environment
like Emacs 24.

Problem reported by Thomas Klausner on pkgsrc-users mailing list.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/_env.c

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



CVS commit: src/distrib/sets

2013-09-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon Sep  9 13:04:58 UTC 2013

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

Log Message:
Add conditional entry for lld.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/distrib/sets/sets.subr
cvs rdiff -u -r1.1834 -r1.1835 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.



CVS commit: src/usr.sbin/postinstall

2013-09-09 Thread Patrick Welche
Module Name:src
Committed By:   prlw1
Date:   Mon Sep  9 15:04:12 UTC 2013

Modified Files:
src/usr.sbin/postinstall: postinstall

Log Message:
Add pkgpath.conf to /etc/defaults check.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/usr.sbin/postinstall/postinstall

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



CVS commit: src/sys/arch/arm/allwinner

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:52:48 UTC 2013

Modified Files:
src/sys/arch/arm/allwinner: awin_reg.h

Log Message:
Add AWIN_AHCI_DMA
Do a little cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/allwinner/awin_reg.h

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



CVS commit: src/sys/arch/evbarm/cubie

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:54:38 UTC 2013

Modified Files:
src/sys/arch/evbarm/cubie: cubie_machdep.c

Log Message:
Cleanup.  Make KGDB work.
We now process the u-boot boot args.


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

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



CVS commit: src/sys/arch/arm/allwinner

2013-09-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Sep  9 17:53:36 UTC 2013

Modified Files:
src/sys/arch/arm/allwinner: awin_board.c

Log Message:
Make sure AWIN_PLL_CFG_BYPASS is cleared (it was but just being safe.)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/allwinner/awin_board.c

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



CVS commit: src/usr.bin/w

2013-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  9 19:20:38 UTC 2013

Modified Files:
src/usr.bin/w: w.c

Log Message:
Expand ep-host to contain the final string that we are going to print
before computing the width of the host column.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/w/w.c

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



CVS commit: src/tests/rump/rumpnet

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:27:49 UTC 2013

Modified Files:
src/tests/rump/rumpnet: t_shmif.sh

Log Message:
Use 8 TCP/IP stacks instead of 16.  That still gives us plenty crossping
testing for 1/4th of the cost.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/rump/rumpnet/t_shmif.sh

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



CVS commit: src/tests/fs/common

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:47:38 UTC 2013

Modified Files:
src/tests/fs/common: fstest_puffs.c

Log Message:
Remove what looks like an outdated assert (there was something very sneaky
about this code, but my memory is fading ...)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/fs/common/fstest_puffs.c

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



CVS commit: src/sbin/resize_ffs

2013-09-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Sep  9 19:37:17 UTC 2013

Modified Files:
src/sbin/resize_ffs: TODO

Log Message:
Add an item to the list (SIGINFO support).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/resize_ffs/TODO

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



CVS commit: src/sys/net

2013-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  9 20:53:52 UTC 2013

Modified Files:
src/sys/net: bpf.c

Log Message:
PR/48198: Peter Bex: Avoid kernel panic caused by setting a very small bpf
buffer size.
XXX: Pullup -6


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/net/bpf.c

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



CVS commit: src/usr.sbin/mtree

2013-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep  9 23:27:43 UTC 2013

Modified Files:
src/usr.sbin/mtree: compare.c create.c spec.c

Log Message:
use intmax_t instead of long long. fixes wrong cast for time_t.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/mtree/compare.c
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/mtree/create.c
cvs rdiff -u -r1.85 -r1.86 src/usr.sbin/mtree/spec.c

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



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

2013-09-09 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Mon Sep  9 19:18:08 UTC 2013

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

Log Message:
Fix minor bug in previous: make sure we come out of rump_init()
without a bound lwp set.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/rump/librump/rumpkern/rump.c

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



CVS commit: src/share/man/man7

2013-09-09 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Tue Sep 10 00:41:51 UTC 2013

Modified Files:
src/share/man/man7: hier.7

Log Message:
PR/48199 - David H. Gutteridge -- remove some vestiges left over from UUCP 
removal


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/share/man/man7/hier.7

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