CVS import: othersrc/external/bsd/multigest

2013-08-16 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Fri Aug 16 06:47:54 UTC 2013

Update of /cvsroot/othersrc/external/bsd/multigest
In directory ivanova.netbsd.org:/tmp/cvs-serv27702

Log Message:
multigest is a library and utility program which calculates multiple
digests in parallel.  The resulting digests are concatenated to make
one large digest value.

The following digest types are supported:

   BLAKE2
   CRC32C
   MD5
   RMD160
   SHA1
   SHA256
   SHA3-224
   SHA3-256
   SHA3-384
   SHA3-512
   SHA512
   SIZE
   TIGER2
   TIGER
   WHIRLPOOL

2 separate interfaces are provided to the multigest routines, and
these mirror the existing digest interfaces:

1. Low-level interface

*_init(), *_update() and *_final() functions

2. High-level interface

*_data and *_file functions

Version Control System Identifiers ($Id$, $NetBSD$, etc) can be
normalised using the -s /regexp/replacement/ argument.  The -r
argument is a shorthand for normalising the RCS/CVS identifiers, $Id$
and $NetBSD$

Multiple digests are specified as part of a comma-specified list.

multigest includes new digest functions, such as the keccak/sha3
family of digests, as well as blake2 (also from the sha3 contest). 
crc32c is provided as a lightweight digest.  A size pseudo-digest
algorithm is provided (suggested a long time ago by tron).

There is also a check command line argument, which allows files
to be compared to previously calculated multigest output.

Sample usage as follows:

% multigest -a sha1,sha256 2.in
SHA1,SHA256 (bin/2.in) () = 
564d6d5d84ba22fb47dded32b90578ef31124457eead5829df188e5e0f06be2760fea7814bb0844121f6dc61da1d0e65896fe445
% multigest -r -a sha1,sha256 2.in
SHA1,SHA256 (bin/2.in) (,\$(Id|NetBSD)[^\n]*\$,$NetBSD$) = 
114f266e7a71dc51811df9dc994bce4de69170c9835bc89fbf57f3a6aa9168b776bd3ef2ba6bcf6e6934a12380b10272ae73679c
% echo -n The quick brown fox jumps over the lazy dog | multigest -a sha3-512
d135bb84d0439dbac432247ee573a23ea7d3c9deb2a968eb31d47c4fb45f1ef4422d6c531b5b9bd6f449ebcc449ea94d0a8f05f62130fda612da53c79659f609

which matches the output shown on the wikipedia page for keccak:

http://en.wikipedia.org/wiki/SHA-3

To check previously calculated multigest values:

% multigest -o calculated -a crc32c,md5,rmd160,sha1,sha256,sha512 -r 2.in
% cat calculated
CRC32C,MD5,RMD160,SHA1,SHA256,SHA512 (2.in) (,\$(Id|NetBSD)[^\n]*\$,$NetBSD$) = 
279934d7b43c46ba05e28788df71eaea4777912ffaad8f20db6708582703a0ef4bc79a61c34a91bc114f266e7a71dc51811df9dc994bce4de69170c9835bc89fbf57f3a6aa9168b776bd3ef2ba6bcf6e6934a12380b10272ae73679ca92644bdf34583700776b58728501c15ee8300feb6ddba910c462618bce2221a0445036a2d46e676ef32988283372710701eb39fa7a59821b740bf07a3d364a5
% multigest -c calculated
provided digest:   
'279934d7b43c46ba05e28788df71eaea4777912ffaad8f20db6708582703a0ef4bc79a61c34a91bc114f266e7a71dc51811df9dc994bce4de69170c9835bc89fbf57f3a6aa9168b776bd3ef2ba6bcf6e6934a12380b10272ae73679ca92644bdf34583700776b58728501c15ee8300feb6ddba910c462618bce2221a0445036a2d46e676ef32988283372710701eb39fa7a59821b740bf07a3d364a5'
calculated digest: 
'279934d7b43c46ba05e28788df71eaea4777912ffaad8f20db6708582703a0ef4bc79a61c34a91bc114f266e7a71dc51811df9dc994bce4de69170c9835bc89fbf57f3a6aa9168b776bd3ef2ba6bcf6e6934a12380b10272ae73679ca92644bdf34583700776b58728501c15ee8300feb6ddba910c462618bce2221a0445036a2d46e676ef32988283372710701eb39fa7a59821b740bf07a3d364a5'
%

Status:

Vendor Tag: CROOKS
Release Tags:   multigest-base

N othersrc/external/bsd/multigest/Makefile
N othersrc/external/bsd/multigest/bin/1.expected
N othersrc/external/bsd/multigest/bin/10.expected
N othersrc/external/bsd/multigest/bin/1.in
N othersrc/external/bsd/multigest/bin/2.in.normalised
N othersrc/external/bsd/multigest/bin/11.expected
N othersrc/external/bsd/multigest/bin/12.expected
N othersrc/external/bsd/multigest/bin/13.expected
N othersrc/external/bsd/multigest/bin/2.expected
N othersrc/external/bsd/multigest/bin/2.in
N othersrc/external/bsd/multigest/bin/4.expected
N othersrc/external/bsd/multigest/bin/5.expected
N othersrc/external/bsd/multigest/bin/6.expected
N othersrc/external/bsd/multigest/bin/7.expected
N othersrc/external/bsd/multigest/bin/8.expected
N othersrc/external/bsd/multigest/bin/9.expected
N othersrc/external/bsd/multigest/bin/Makefile
N othersrc/external/bsd/multigest/bin/18.expected
N othersrc/external/bsd/multigest/bin/15.expected
N othersrc/external/bsd/multigest/bin/16.expected
N othersrc/external/bsd/multigest/bin/17.expected
N othersrc/external/bsd/multigest/bin/19.expected
N othersrc/external/bsd/multigest/bin/20.expected
N othersrc/external/bsd/multigest/lib/shlib_version
N othersrc/external/bsd/multigest/lib/Makefile
N othersrc/external/bsd/multigest/dist/libmultigest.3
N othersrc/external/bsd/multigest/dist/multigest.1
N othersrc/external/bsd/multigest/dist/blake2.c
N 

CVS commit: othersrc/external/bsd/multigest/dist

2013-08-16 Thread Thomas Klausner
Module Name:othersrc
Committed By:   wiz
Date:   Fri Aug 16 07:38:38 UTC 2013

Modified Files:
othersrc/external/bsd/multigest/dist: multigest.1

Log Message:
Replace standard sentence by standard macro in standard section.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/multigest/dist/multigest.1

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/multigest/dist/multigest.1
diff -u othersrc/external/bsd/multigest/dist/multigest.1:1.1.1.1 othersrc/external/bsd/multigest/dist/multigest.1:1.2
--- othersrc/external/bsd/multigest/dist/multigest.1:1.1.1.1	Fri Aug 16 06:47:53 2013
+++ othersrc/external/bsd/multigest/dist/multigest.1	Fri Aug 16 07:38:38 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: multigest.1,v 1.1.1.1 2013/08/16 06:47:53 agc Exp $
+.\ $NetBSD: multigest.1,v 1.2 2013/08/16 07:38:38 wiz Exp $
 .\
 .\ Copyright (c) 2013 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -52,10 +52,8 @@ utility is a simple wrapper for the vari
 algorithm implementations, which are located in the standard
 C library, and was designed to be scalable as new message digest
 algorithms are developed.
-.Pp
-The
-.Nm
-utility exits 0 on success, and \*[Gt]0 if an error occurs.
+.Sh EXIT STATUS
+.Ex -std multigest
 .Sh SEE ALSO
 .Xr libmultigest 3
 .Sh HISTORY



CVS commit: othersrc/external/bsd/multigest/dist

2013-08-16 Thread Thomas Klausner
Module Name:othersrc
Committed By:   wiz
Date:   Fri Aug 16 07:38:14 UTC 2013

Modified Files:
othersrc/external/bsd/multigest/dist: libmultigest.3

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
othersrc/external/bsd/multigest/dist/libmultigest.3

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/multigest/dist/libmultigest.3
diff -u othersrc/external/bsd/multigest/dist/libmultigest.3:1.1.1.1 othersrc/external/bsd/multigest/dist/libmultigest.3:1.2
--- othersrc/external/bsd/multigest/dist/libmultigest.3:1.1.1.1	Fri Aug 16 06:47:53 2013
+++ othersrc/external/bsd/multigest/dist/libmultigest.3	Fri Aug 16 07:38:14 2013
@@ -1,4 +1,4 @@
-.\ $NetBSD: libmultigest.3,v 1.1.1.1 2013/08/16 06:47:53 agc Exp $
+.\ $NetBSD: libmultigest.3,v 1.2 2013/08/16 07:38:14 wiz Exp $
 .\
 .\ Copyright (c) 2013 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -90,7 +90,8 @@ Up to 32 digests can be specified on the
 The data being used as input to the digest can be modified
 by using a regular expression-based substitution operation,
 so that any Version Control System identifiers can be normalised
-before being digested. If no substitution regular expression is provided,
+before being digested.
+If no substitution regular expression is provided,
 the input data will be used as-is.
 .Pp
 The list of digests provided is:



CVS commit: src/tools/gmake

2013-08-16 Thread Grégoire Sutre
Module Name:src
Committed By:   gsutre
Date:   Fri Aug 16 10:29:32 UTC 2013

Modified Files:
src/tools/gmake: Makefile

Log Message:
Use makeinfo built from src/tools/texinfo.  Fixes PR toolchain/48123.
ok apb@


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tools/gmake/Makefile

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

Modified files:

Index: src/tools/gmake/Makefile
diff -u src/tools/gmake/Makefile:1.2 src/tools/gmake/Makefile:1.3
--- src/tools/gmake/Makefile:1.2	Fri Oct 27 22:36:23 2006
+++ src/tools/gmake/Makefile	Fri Aug 16 10:29:32 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2006/10/27 22:36:23 uwe Exp $
+#	$NetBSD: Makefile,v 1.3 2013/08/16 10:29:32 gsutre Exp $
 #
 
 GNUHOSTDIST=	${.CURDIR}/../../gnu/dist/gmake
@@ -11,6 +11,8 @@ CONFIGURE_ENV+=	CC=${HOST_CC:Q} \
 CONFIGURE_ARGS=	--program-prefix=${_TOOL_PREFIX}g
 CONFIGURE_ARGS+=--disable-nls
 
+MAKE_ARGS=	MAKEINFO=${TOOL_MAKEINFO:Q}
+
 .NOTPARALLEL:
 
 .include ${.CURDIR}/../Makefile.gnuhost



CVS commit: src/tests/lib/libexecinfo

2013-08-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 16 11:57:15 UTC 2013

Modified Files:
src/tests/lib/libexecinfo: t_backtrace.c

Log Message:
Prevent inlining of the main testcase body function.
Do not mark the inner functions static, as they might get cloned then
(ending up being called myfunc3.clone.3 instead of myfunc).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libexecinfo/t_backtrace.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/libexecinfo/t_backtrace.c
diff -u src/tests/lib/libexecinfo/t_backtrace.c:1.9 src/tests/lib/libexecinfo/t_backtrace.c:1.10
--- src/tests/lib/libexecinfo/t_backtrace.c:1.9	Thu Aug 15 12:42:25 2013
+++ src/tests/lib/libexecinfo/t_backtrace.c	Fri Aug 16 11:57:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_backtrace.c,v 1.9 2013/08/15 12:42:25 joerg Exp $	*/
+/*	$NetBSD: t_backtrace.c,v 1.10 2013/08/16 11:57:15 martin Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_backtrace.c,v 1.9 2013/08/15 12:42:25 joerg Exp $);
+__RCSID($NetBSD: t_backtrace.c,v 1.10 2013/08/16 11:57:15 martin Exp $);
 
 #include atf-c.h
 #include atf-c/config.h
@@ -42,9 +42,14 @@ __RCSID($NetBSD: t_backtrace.c,v 1.9 20
 #define __arraycount(a) (sizeof(a) / sizeof(a[0]))
 #endif
 
+void myfunc3(size_t ncalls);
+void myfunc2(size_t ncalls);
+void myfunc1(size_t origcalls, volatile size_t ncalls);
+void myfunc(size_t ncalls);
+
 volatile int prevent_inline;
 
-static void
+void
 myfunc3(size_t ncalls)
 {
 	static const char *top[] = { myfunc, atfu_backtrace_fmt_basic_body,
@@ -90,7 +95,7 @@ myfunc3(size_t ncalls)
 		vfork();
 }
 
-static void
+void
 myfunc2(size_t ncalls)
 {
 	myfunc3(ncalls);
@@ -99,7 +104,7 @@ myfunc2(size_t ncalls)
 		vfork();
 }
 
-static void
+void
 myfunc1(size_t origcalls, volatile size_t ncalls)
 {
 	if (ncalls  1)
@@ -111,7 +116,7 @@ myfunc1(size_t origcalls, volatile size_
 		vfork();
 }
 
-static void
+void
 myfunc(size_t ncalls)
 {
 	myfunc1(ncalls, ncalls);
@@ -129,6 +134,9 @@ ATF_TC_HEAD(backtrace_fmt_basic, tc)
 ATF_TC_BODY(backtrace_fmt_basic, tc)
 {
 	myfunc(12);
+
+	if (prevent_inline)
+		vfork();
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/sys/arch/hp300

2013-08-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Aug 16 13:39:47 UTC 2013

Modified Files:
src/sys/arch/hp300/conf: GENERIC files.hp300
src/sys/arch/hp300/hp300: locore.s machdep.c trap.c

Log Message:
Make FPU_EMULATE work on NetBSD/hp300.  Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.226 -r1.227 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/hp300/hp300/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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.179 src/sys/arch/hp300/conf/GENERIC:1.180
--- src/sys/arch/hp300/conf/GENERIC:1.179	Sun Jun 30 21:38:57 2013
+++ src/sys/arch/hp300/conf/GENERIC	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.179 2013/06/30 21:38:57 rmind Exp $
+# $NetBSD: GENERIC,v 1.180 2013/08/16 13:39:47 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	arch/hp300/conf/std.hp300
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.179 $
+#ident 		GENERIC-$Revision: 1.180 $
 
 maxusers	32		# estimated number of users
 
@@ -43,6 +43,7 @@ options 	HP400
 options 	HP425
 options 	HP433
 options 	FPSP		# floating point interface for 68040
+#options 	FPU_EMULATE	# software fpu emulation for MC68030
 
 # Standard system options
 options 	KTRACE		# system call tracing support

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.85 src/sys/arch/hp300/conf/files.hp300:1.86
--- src/sys/arch/hp300/conf/files.hp300:1.85	Sun Jun 12 03:35:40 2011
+++ src/sys/arch/hp300/conf/files.hp300	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.85 2011/06/12 03:35:40 rmind Exp $
+#	$NetBSD: files.hp300,v 1.86 2013/08/16 13:39:47 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -208,6 +208,7 @@ file	arch/hp300/hp300/trap.c
 file	arch/hp300/hp300/disksubr.c
 file	arch/m68k/m68k/cacheops.c
 file	arch/m68k/m68k/db_memrw.c		ddb | kgdb
+file	arch/m68k/m68k/fpu.c
 file	arch/m68k/m68k/kgdb_machdep.c		kgdb
 file	arch/m68k/m68k/pmap_motorola.c
 file	arch/m68k/m68k/procfs_machdep.c		procfs
@@ -216,6 +217,10 @@ file	arch/m68k/m68k/vm_machdep.c
 
 file	dev/cons.c
 
+# Emulation modules
+# 6888x emulator (FPU_EMULATE)
+include arch/m68k/fpe/files.fpe
+
 # NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K)
 include	compat/aoutm68k/files.aoutm68k
 

Index: src/sys/arch/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.165 src/sys/arch/hp300/hp300/locore.s:1.166
--- src/sys/arch/hp300/hp300/locore.s:1.165	Thu Dec 22 15:33:29 2011
+++ src/sys/arch/hp300/hp300/locore.s	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.165 2011/12/22 15:33:29 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.166 2013/08/16 13:39:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -576,6 +576,8 @@ Lenab1:
 	movl	#USRSTACK-4,%a2
 	movl	%a2,%usp		| init user SP
 
+	jbsr	_C_LABEL(fpu_probe)
+	movl	%d0,_C_LABEL(fputype)
 	tstl	_C_LABEL(fputype)	| Have an FPU?
 	jeq	Lenab2			| No, skip.
 	clrl	%a1@(PCB_FPCTX)		| ensure null FP context

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.226 src/sys/arch/hp300/hp300/machdep.c:1.227
--- src/sys/arch/hp300/hp300/machdep.c:1.226	Fri Aug 10 12:29:59 2012
+++ src/sys/arch/hp300/hp300/machdep.c	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.227 2013/08/16 13:39:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,10 +39,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.227 2013/08/16 13:39:47 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
+#include opt_fpu_emulate.h
 #include opt_modular.h
 #include opt_panicbutton.h
 
@@ -447,6 +448,13 @@ identifycpu(void)
 		len += sprintf(cpu_model + len, , %sMHz MC68881 FPU,
 		machineid == HP_350 ? 20 : 16.67);
 		break;
+	case FPU_NONE:
+#ifdef FPU_EMULATE
+		len += sprintf(cpu_model + len, , emulated FPU);
+#else
+		len += sprintf(cpu_model + len, , no FPU);
+#endif
+		break;
 	default:
 		len += sprintf(cpu_model + len, , unknown FPU);
 	}

Index: src/sys/arch/hp300/hp300/trap.c
diff -u src/sys/arch/hp300/hp300/trap.c:1.149 src/sys/arch/hp300/hp300/trap.c:1.150
--- src/sys/arch/hp300/hp300/trap.c:1.149	Sun Feb 19 21:06:07 2012
+++ src/sys/arch/hp300/hp300/trap.c	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: 

CVS commit: src/lib/libc/net

2013-08-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 16 15:27:12 UTC 2013

Modified Files:
src/lib/libc/net: gethnamaddr.c getnameinfo.c sethostent.c
Added Files:
src/lib/libc/net: hostent.h

Log Message:
Add not advertised reentrant functions: {get,set,end}hostent_r,
gethostbyname{,2}_r, gethostbyaddr_r. Make getnameinfo(3) use
gethostbyaddr_r(3) so it is re-entrant (ahem __ypdomain). These
are not being advertised because there is a bunch of different
implementation of them that have a variety of type signatures.

If people want to follow someone's implementation, it is now easy.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/lib/libc/net/gethnamaddr.c
cvs rdiff -u -r1.53 -r1.54 src/lib/libc/net/getnameinfo.c
cvs rdiff -u -r0 -r1.1 src/lib/libc/net/hostent.h
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/net/sethostent.c

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

Modified files:

Index: src/lib/libc/net/gethnamaddr.c
diff -u src/lib/libc/net/gethnamaddr.c:1.79 src/lib/libc/net/gethnamaddr.c:1.80
--- src/lib/libc/net/gethnamaddr.c:1.79	Sun Sep  9 12:42:23 2012
+++ src/lib/libc/net/gethnamaddr.c	Fri Aug 16 11:27:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: gethnamaddr.c,v 1.79 2012/09/09 16:42:23 christos Exp $	*/
+/*	$NetBSD: gethnamaddr.c,v 1.80 2013/08/16 15:27:12 christos Exp $	*/
 
 /*
  * ++Copyright++ 1985, 1988, 1993
@@ -57,7 +57,7 @@
 static char sccsid[] = @(#)gethostnamadr.c	8.1 (Berkeley) 6/4/93;
 static char rcsid[] = Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ;
 #else
-__RCSID($NetBSD: gethnamaddr.c,v 1.79 2012/09/09 16:42:23 christos Exp $);
+__RCSID($NetBSD: gethnamaddr.c,v 1.80 2013/08/16 15:27:12 christos Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -95,6 +95,8 @@ __RCSID($NetBSD: gethnamaddr.c,v 1.79 2
 #include rpcsvc/ypclnt.h
 #endif
 
+#include hostent.h
+
 #if defined(_LIBC)  defined(__weak_alias)
 __weak_alias(gethostbyaddr,_gethostbyaddr)
 __weak_alias(gethostbyname,_gethostbyname)
@@ -111,31 +113,23 @@ __weak_alias(gethostent,_gethostent)
 #define	MAXADDRS	35
 
 static const char AskedForGot[] =
-			  gethostby*.getanswer: asked for \%s\, got \%s\;
+gethostby*.getanswer: asked for \%s\, got \%s\;
 
-static char *h_addr_ptrs[MAXADDRS + 1];
 
 #ifdef YP
 static char *__ypdomain;
 #endif
 
-static struct hostent host;
-static char *host_aliases[MAXALIASES];
-static char hostbuf[8*1024];
-static u_int32_t host_addr[16 / sizeof(u_int32_t)];	/* IPv4 or IPv6 */
-static FILE *hostf = NULL;
-static int stayopen = 0;
-
 #define	MAXPACKET	(64*1024)
 
 typedef union {
-HEADER hdr;
-u_char buf[MAXPACKET];
+	HEADER hdr;
+	u_char buf[MAXPACKET];
 } querybuf;
 
 typedef union {
-int32_t al;
-char ac;
+	int32_t al;
+	char ac;
 } align;
 
 #ifdef DEBUG
@@ -143,33 +137,23 @@ static void debugprintf(const char *, re
 	__attribute__((__format__(__printf__, 1, 3)));
 #endif
 static struct hostent *getanswer(const querybuf *, int, const char *, int,
-res_state);
+res_state, struct hostent *, char *, size_t, int *);
 static void map_v4v6_address(const char *, char *);
 static void map_v4v6_hostent(struct hostent *, char **, char *);
 static void addrsort(char **, int, res_state);
 
-void _sethtent(int);
-void _endhtent(void);
-struct hostent *_gethtent(void);
-void ht_sethostent(int);
-void ht_endhostent(void);
-struct hostent *ht_gethostbyname(char *);
-struct hostent *ht_gethostbyaddr(const char *, int, int);
 void dns_service(void);
 #undef dn_skipname
 int dn_skipname(const u_char *, const u_char *);
-int _gethtbyaddr(void *, void *, va_list);
-int _gethtbyname(void *, void *, va_list);
-struct hostent *_gethtbyname2(const char *, int);
-int _dns_gethtbyaddr(void *, void *, va_list);
-int _dns_gethtbyname(void *, void *, va_list);
+
+static struct hostent *_hf_gethtbyname2(const char *, int, struct getnamaddr *);
+
 #ifdef YP
-struct hostent *_yphostent(char *, int);
-int _yp_gethtbyaddr(void *, void *, va_list);
-int _yp_gethtbyname(void *, void *, va_list);
+static struct hostent *_yp_hostent(char *, int, struct getnamaddr *);
 #endif
 
-static struct hostent *gethostbyname_internal(const char *, int, res_state);
+static struct hostent *gethostbyname_internal(const char *, int, res_state,
+struct hostent *, char *, size_t, int *);
 
 static const ns_src default_dns_files[] = {
 	{ NSSRC_FILES, 	NS_SUCCESS },
@@ -178,6 +162,33 @@ static const ns_src default_dns_files[] 
 };
 
 
+#define ARRAY(dst, anum, ptr, len) \
+	do { \
+		size_t _len = (anum + 1) * sizeof(*dst); \
+		if (_len  len) \
+			goto nospc; \
+		dst = (void *)ptr; \
+		ptr += _len; \
+		len -= _len; \
+	} while (/*CONSTCOND*/0)
+
+#define COPY(dst, src, slen, ptr, len) \
+	do { \
+		if ((size_t)slen  len) \
+			goto nospc; \
+		memcpy(ptr, src, (size_t)slen); \
+		dst = ptr; \
+		ptr += slen; \
+		len -= slen; \
+	} while (/* CONSTCOND */0)
+
+#define SCOPY(dst, src, ptr, 

CVS commit: src/tests/lib/libc/net

2013-08-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 16 15:29:45 UTC 2013

Modified Files:
src/tests/lib/libc/net: Makefile
Added Files:
src/tests/lib/libc/net: h_hostent.c hosts t_hostent.sh

Log Message:
test harness for gethostbyname()/gethostbyaddr() and their internal bits.
XXX[1]: How can we avoid using hard-coded hosts for DNS
XXX[2]: How do we test NIS?


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/net/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/net/h_hostent.c \
src/tests/lib/libc/net/hosts src/tests/lib/libc/net/t_hostent.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/lib/libc/net/Makefile
diff -u src/tests/lib/libc/net/Makefile:1.7 src/tests/lib/libc/net/Makefile:1.8
--- src/tests/lib/libc/net/Makefile:1.7	Sat Sep 15 12:22:58 2012
+++ src/tests/lib/libc/net/Makefile	Fri Aug 16 11:29:45 2013
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.7 2012/09/15 16:22:58 plunky Exp $
+# $NetBSD: Makefile,v 1.8 2013/08/16 15:29:45 christos Exp $
 
 .include bsd.own.mk
 
 MKMAN=	no
 
 TESTS_SUBDIRS+=	getaddrinfo
+FILES+=hosts
 
 TESTSDIR=	${TESTSBASE}/lib/libc/net
 
@@ -19,12 +20,20 @@ aton_ether_subr.c: gen_ether_subr ${NETB
 TESTS_SH+=	t_nsdispatch
 TESTS_SH+=	t_protoent
 TESTS_SH+=	t_servent
+TESTS_SH+=	t_hostent
 
 BINDIR=		${TESTSDIR}
 
 PROGS+=		h_nsd_recurse
 PROGS+=		h_protoent
 PROGS+=		h_servent
+PROGS+=		h_hostent
+CPPFLAGS.h_hostent.c += -I${NETBSDSRCDIR}/lib/libc/net
+
+# For easy debugging, without installing libc
+#.PATH.c:${NETBSDSRCDIR}/lib/libc/net
+#SRCS.h_hostent = h_hostent.c gethnamaddr.c
+#DBG=-g3
 
 LDADD.h_nsd_recurse+=	-lpthread
 

Added files:

Index: src/tests/lib/libc/net/h_hostent.c
diff -u /dev/null src/tests/lib/libc/net/h_hostent.c:1.1
--- /dev/null	Fri Aug 16 11:29:45 2013
+++ src/tests/lib/libc/net/h_hostent.c	Fri Aug 16 11:29:45 2013
@@ -0,0 +1,190 @@
+/*	$NetBSD: h_hostent.c,v 1.1 2013/08/16 15:29:45 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include sys/cdefs.h
+__RCSID($NetBSD: h_hostent.c,v 1.1 2013/08/16 15:29:45 christos Exp $);
+
+#include stdio.h
+#include string.h
+#include nsswitch.h
+#include netdb.h
+#include stdint.h
+#include stdlib.h
+#include unistd.h
+#include err.h
+
+#include netinet/in.h
+#include sys/types.h
+#include arpa/nameser.h
+#include arpa/inet.h
+
+#include hostent.h
+
+static void
+phostent(const struct hostent *h)
+{
+	size_t i;
+	char buf[1024];
+	const int af = h-h_length == NS_INADDRSZ ? AF_INET : AF_INET6;
+
+	printf(name=%s, length=%d, addrtype=%d, aliases=[,
+	h-h_name, h-h_length, h-h_addrtype);
+
+	for (i = 0; h-h_aliases[i]; i++)
+		printf(%s%s, i == 0 ?  :  , h-h_aliases[i]);
+
+	printf(] addr_list=[);
+
+	for (i = 0; h-h_addr_list[i]; i++)
+		printf(%s%s, i == 0 ?  :  , inet_ntop(af,
+		h-h_addr_list[i], buf, (socklen_t)sizeof(buf)));
+
+	printf(]\n);
+}
+
+static void
+usage(void)
+{
+	(void)fprintf(stderr, Usage: %s [-f hostsfile] 
+	[-t any|dns|nis|files] 
+	[-46a] name|address\n, getprogname());
+	exit(EXIT_FAILURE);
+}
+
+static void
+getby(int (*f)(void *, void *, va_list), struct getnamaddr *info, ...)
+{
+	va_list ap;
+	int e;
+
+	va_start(ap, info);
+	e = (*f)(info, NULL, ap);
+	va_end(ap);
+	switch (e) {
+	case NS_SUCCESS:
+		phostent(info-hp);
+		break;
+	default:
+		printf(error %d\n, e);
+		break;
+	}
+}
+
+static void
+geta(struct hostent *hp) {
+	if (hp == 

CVS commit: src/distrib/sets/lists

2013-08-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 16 15:34:05 UTC 2013

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi

Log Message:
new hostent related tests.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.544 -r1.545 src/distrib/sets/lists/tests/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/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.30 src/distrib/sets/lists/debug/mi:1.31
--- src/distrib/sets/lists/debug/mi:1.30	Wed Aug 14 05:31:41 2013
+++ src/distrib/sets/lists/debug/mi	Fri Aug 16 11:34:05 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.30 2013/08/14 09:31:41 pooka Exp $
+# $NetBSD: mi,v 1.31 2013/08/16 15:34:05 christos Exp $
 
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib/i18n/libBIG5_g.a			-unknown-		debuglib
@@ -1791,6 +1791,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wcstod.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/locale/t_wctomb.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/getaddrinfo/h_gai.debug	tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/net/h_hostent.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/h_nsd_recurse.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/h_protoent.debug		tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/net/h_servent.debug		tests-lib-debug		debug,atf

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.544 src/distrib/sets/lists/tests/mi:1.545
--- src/distrib/sets/lists/tests/mi:1.544	Sun Aug 11 18:29:03 2013
+++ src/distrib/sets/lists/tests/mi	Fri Aug 16 11:34:05 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.544 2013/08/11 22:29:03 joerg Exp $
+# $NetBSD: mi,v 1.545 2013/08/16 15:34:05 christos Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -1978,9 +1978,12 @@
 ./usr/tests/lib/libc/net/getaddrinfo/data/unsup_fam.exp		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/getaddrinfo/h_gai	tests-lib-tests		atf
 ./usr/tests/lib/libc/net/getaddrinfo/t_getaddrinfo tests-lib-tests	atf
+./usr/tests/lib/libc/net/hosts		tests-lib-tests	atf
+./usr/tests/lib/libc/net/h_hostent		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/h_nsd_recurse		tests-lib-tests	atf
 ./usr/tests/lib/libc/net/h_protoent		tests-lib-tests		atf
 ./usr/tests/lib/libc/net/h_servent		tests-lib-tests		atf
+./usr/tests/lib/libc/net/t_hostent		tests-lib-tests		atf
 ./usr/tests/lib/libc/net/t_ether_aton		tests-lib-tests		atf
 ./usr/tests/lib/libc/net/t_getprotoent		tests-lib-tests		atf
 ./usr/tests/lib/libc/net/t_nsdispatch		tests-lib-tests		atf



CVS commit: src/lib/libc/arch/arm/misc

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 17:09:27 UTC 2013

Modified Files:
src/lib/libc/arch/arm/misc: arm_initfini.c

Log Message:
Make _libc_arm_fpu_present hidden


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/arm/misc/arm_initfini.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/arch/arm/misc/arm_initfini.c
diff -u src/lib/libc/arch/arm/misc/arm_initfini.c:1.3 src/lib/libc/arch/arm/misc/arm_initfini.c:1.4
--- src/lib/libc/arch/arm/misc/arm_initfini.c:1.3	Tue Jul 30 10:47:44 2013
+++ src/lib/libc/arch/arm/misc/arm_initfini.c	Fri Aug 16 17:09:27 2013
@@ -29,7 +29,7 @@
 
 #include sys/cdefs.h
 
-__RCSID($NetBSD: arm_initfini.c,v 1.3 2013/07/30 10:47:44 skrll Exp $);
+__RCSID($NetBSD: arm_initfini.c,v 1.4 2013/08/16 17:09:27 matt Exp $);
 
 #include namespace.h
 
@@ -46,7 +46,7 @@ __RCSID($NetBSD: arm_initfini.c,v 1.3 2
 #include stdbool.h
 #include stddef.h
 
-int _libc_arm_fpu_present;
+__dso_hidden int _libc_arm_fpu_present;
 static bool _libc_aapcs_initialized;
 
 void	_libc_aapcs_init(void) __attribute__((__constructor__, __used__));



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 17:45:28 UTC 2013

Modified Files:
src/sys/arch/arm/include: asm.h

Log Message:
Don't define RETc if Thumb1
Add REL_SYM(a, b)
Make GOT_INIT* thumb aware.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/include/asm.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/include/asm.h
diff -u src/sys/arch/arm/include/asm.h:1.20 src/sys/arch/arm/include/asm.h:1.21
--- src/sys/arch/arm/include/asm.h:1.20	Tue Aug 13 00:18:15 2013
+++ src/sys/arch/arm/include/asm.h	Fri Aug 16 17:45:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.20 2013/08/13 00:18:15 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.21 2013/08/16 17:45:28 matt Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -73,16 +73,20 @@
  */
 #define _ASM_TYPE_FUNCTION	%function
 #define _ASM_TYPE_OBJECT	%object
-#define _THUMB_ENTRY(x) \
-	.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; \
+#define _THUMB_ENTRY_NS(x) \
+	_ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; \
 	.thumb_func; .code 16; x:
-#define _ARM_ENTRY(x) \
-	.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; \
+#define _THUMB_ENTRY(x) .text; _THUMB_ENTRY_NS(x)
+#define _ARM_ENTRY_NS(x) \
+	_ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; \
 	.code 32; x:
+#define _ARM_ENTRY(x)	.text; _ARM_ENTRY_NS(x)
 #ifdef __thumb__
 #define	_ENTRY(x)	_THUMB_ENTRY(x)
+#define	_ENTRY_NS(x)	_THUMB_ENTRY_NS(x)
 #else
 #define	_ENTRY(x)	_ARM_ENTRY(x)
+#define	_ENTRY_NS(x)	_ARM_ENTRY_NS(x)
 #endif
 #define	_END(x)		.size x,.-x
 
@@ -102,7 +106,8 @@
 
 #define	ASMSTR		.asciz
 
-#if defined(PIC)
+#if defined(PIC) || defined(__pic__)
+#define	REL_SYM(a, b)	((a) - (b))
 #ifdef __thumb__
 #define	PLT_SYM(x)	x
 #define	GOT_SYM(x)	PIC_SYM(x, GOTOFF)
@@ -120,10 +125,16 @@
 
 #define	GOT_INIT(got,gotsym,pclabel) \
 	ldr	got, gotsym;	\
-	add	got, got, pc;	\
-	pclabel:
+	pclabel: add	got, got, pc
+#ifdef __thumb__
+#define	GOT_INITSYM(gotsym,pclabel) \
+	.align 0;		\
+	gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+4)
+#else
 #define	GOT_INITSYM(gotsym,pclabel) \
-	gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4))
+	.align 0;		\
+	gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+8)
+#endif
 
 #ifdef __STDC__
 #define	PIC_SYM(x,y)	x ## ( ## y ## )
@@ -132,6 +143,7 @@
 #endif
 
 #else
+#define	REL_SYM(a, b)	(a)
 #define	PLT_SYM(x)	x
 #define	GOT_SYM(x)	x
 #define	GOT_GET(x,got,sym)	\
@@ -184,7 +196,9 @@
 # define RET		bx		lr
 # define RETr(r)	bx		r
 # if defined(__thumb__)
-#  define RETc(c)	it c; __CONCAT(bx,c)	lr
+#  if defined(_ARM_ARCH_7)
+#   define RETc(c)	it c; __CONCAT(bx,c)	lr
+#  endif
 # else
 #  define RETc(c)	__CONCAT(bx,c)	lr
 # endif



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 21:04:07 UTC 2013

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: arm-cores.def

Log Message:
Teach gcc to recognize a7  a15 as a9 but with hwdiv.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def

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/dist/gcc/config/arm/arm-cores.def
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def:1.2
--- src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def:1.1.1.1	Tue Jun 21 01:22:22 2011
+++ src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def	Fri Aug 16 21:04:07 2013
@@ -119,8 +119,10 @@ ARM_CORE(mpcore,	  mpcore,	6K, FL_
 ARM_CORE(arm1156t2-s,	  arm1156t2s,	6T2, FL_LDSCHED, 9e)
 ARM_CORE(arm1156t2f-s,  arm1156t2fs,  6T2, FL_LDSCHED | FL_VFPV2, 9e)
 ARM_CORE(cortex-a5,	  cortexa5,	7A, FL_LDSCHED, 9e)
+ARM_CORE(cortex-a7,	  cortexa9,	7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, 9e)
 ARM_CORE(cortex-a8,	  cortexa8,	7A, FL_LDSCHED, 9e)
 ARM_CORE(cortex-a9,	  cortexa9,	7A, FL_LDSCHED, 9e)
+ARM_CORE(cortex-a15,	  cortexa9,	7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, 9e)
 ARM_CORE(cortex-r4,	  cortexr4,	7R, FL_LDSCHED, 9e)
 ARM_CORE(cortex-r4f,	  cortexr4f,	7R, FL_LDSCHED, 9e)
 ARM_CORE(cortex-m3,	  cortexm3,	7M, FL_LDSCHED, 9e)



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 21:42:48 UTC 2013

Modified Files:
src/sys/arch/arm/include: profile.h

Log Message:
__mcount is always arm code (even if compiled -mthumb).
Add .cfi for unwind tables


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/profile.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/include/profile.h
diff -u src/sys/arch/arm/include/profile.h:1.9 src/sys/arch/arm/include/profile.h:1.10
--- src/sys/arch/arm/include/profile.h:1.9	Thu Aug 15 22:41:15 2013
+++ src/sys/arch/arm/include/profile.h	Fri Aug 16 21:42:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.9 2013/08/15 22:41:15 matt Exp $	*/
+/*	$NetBSD: profile.h,v 1.10 2013/08/16 21:42:48 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris
@@ -54,10 +54,20 @@
 	__asm(.type	 MCOUNT_ASM_NAME ,%function);		\
 	__asm(.global	 MCOUNT_ASM_NAME);\
 	__asm(MCOUNT_ASM_NAME :);	\
+	__asm(.cfi_startproc);	\
+	__asm(.fnstart);		\
 	/*\
 	 * Preserve registers that are trashed during mcount		\
 	 */\
 	__asm(push	{r0-r3, ip, lr});\
+	__asm(.save {r0-r3, ip, lr});	\
+	__asm(.cfi_def_cfa_offset 24);\
+	__asm(.cfi_offset 14, -4);	\
+	__asm(.cfi_offset 12, -8);	\
+	__asm(.cfi_offset 3, -12);	\
+	__asm(.cfi_offset 2, -16);	\
+	__asm(.cfi_offset 1, -20);	\
+	__asm(.cfi_offset 0, -24);	\
 	/* Check what mode we're in.  EQ = 32, NE = 26 */		\
 	__asm(teq	r0, r0);	\
 	__asm(teq	pc, r15);	\
@@ -81,52 +91,32 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm(pop	{r0-r3, lr, pc});\
-	__asm(.size	 MCOUNT_ASM_NAME , .- MCOUNT_ASM_NAME);
-#elif !defined(__thumb__) || defined(_ARM_ARCH_T2)
-#define	MCOUNT\
-	__asm(.text);			\
-	__asm(.align	0);		\
-	__asm(.type	 MCOUNT_ASM_NAME ,%function);		\
-	__asm(.global	 MCOUNT_ASM_NAME);\
-	__asm(MCOUNT_ASM_NAME :);	\
-	/*\
-	 * Preserve registers that are trashed during mcount		\
-	 */\
-	__asm(push	{r0-r3, ip, lr});\
-	/*\
-	 * find the return address for mcount,\
-	 * and the return address for mcount's caller.			\
-	 *\
-	 * frompcindex = pc pushed by call into self.			\
-	 */\
-	__asm(mov	r0, ip);	\
-	/*\
-	 * selfpc = pc pushed by mcount call\
-	 */\
-	__asm(mov	r1, lr);	\
-	/*\
-	 * Call the real mcount code	\
-	 */\
-	__asm(bl	 ___STRING(_C_LABEL(_mcount)) PLTSYM);		\
-	/*\
-	 * Restore registers that were trashed during mcount		\
-	 */\
-	__asm(pop	{r0-r3, lr, pc});\
+	__asm(pop	{r0-r3, pc});	\
+	__asm(.cfi_endproc);		\
+	__asm(.fnend);		\
 	__asm(.size	 MCOUNT_ASM_NAME , .- MCOUNT_ASM_NAME);
 #else
 #define	MCOUNT\
 	__asm(.text);			\
 	__asm(.align	0);		\
-	__asm(.thumb_func);		\
 	__asm(.type	 MCOUNT_ASM_NAME ,%function);		\
 	__asm(.global	 MCOUNT_ASM_NAME);\
+	__asm(.arm);			\
 	__asm(MCOUNT_ASM_NAME :);	\
+	__asm(.fnstart);		\
+	__asm(.cfi_startproc);	\
 	/*\
 	 * Preserve registers that are trashed during mcount		\
 	 */\
-	__asm(push	{r0-r4,lr});	\
-	__asm(mov	r4, ip);	\
+	__asm(push	{r0-r4, ip, lr});\
+	__asm(.save {r0-r4, lr});	\
+	__asm(.cfi_def_cfa_offset 24);\
+	__asm(.cfi_offset 14, -4);	\
+	__asm(.cfi_offset 4, -8);	\
+	__asm(.cfi_offset 3, -12);	\
+	__asm(.cfi_offset 2, -16);	\
+	__asm(.cfi_offset 1, -20);	\
+	__asm(.cfi_offset 0, -24);	\
 	/*\
 	 * find the return address for mcount,\
 	 * and the return address for mcount's caller.			\
@@ -145,8 +135,9 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm(mov	lr, r4);	\
-	__asm(pop	{r0-r4, pc});	\
+	__asm(pop	{r0-r4, lr, pc});\
+	__asm(.cfi_endproc);		\
+	__asm(.fnend);		\
 	__asm(.size	 MCOUNT_ASM_NAME , .- MCOUNT_ASM_NAME);
 #endif
 



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 21:59:02 UTC 2013

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: arm-cores.def

Log Message:
Fix botch.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def

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/dist/gcc/config/arm/arm-cores.def
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def:1.2 src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def:1.3
--- src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def:1.2	Fri Aug 16 21:04:07 2013
+++ src/external/gpl3/gcc/dist/gcc/config/arm/arm-cores.def	Fri Aug 16 21:59:01 2013
@@ -119,10 +119,10 @@ ARM_CORE(mpcore,	  mpcore,	6K, FL_
 ARM_CORE(arm1156t2-s,	  arm1156t2s,	6T2, FL_LDSCHED, 9e)
 ARM_CORE(arm1156t2f-s,  arm1156t2fs,  6T2, FL_LDSCHED | FL_VFPV2, 9e)
 ARM_CORE(cortex-a5,	  cortexa5,	7A, FL_LDSCHED, 9e)
-ARM_CORE(cortex-a7,	  cortexa9,	7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, 9e)
+ARM_CORE(cortex-a7,	  cortexa7,	7A, FL_LDSCHED | FL_DIV, 9e)
 ARM_CORE(cortex-a8,	  cortexa8,	7A, FL_LDSCHED, 9e)
 ARM_CORE(cortex-a9,	  cortexa9,	7A, FL_LDSCHED, 9e)
-ARM_CORE(cortex-a15,	  cortexa9,	7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, 9e)
+ARM_CORE(cortex-a15,	  cortexa15,	7A, FL_LDSCHED | FL_DIV, 9e)
 ARM_CORE(cortex-r4,	  cortexr4,	7R, FL_LDSCHED, 9e)
 ARM_CORE(cortex-r4f,	  cortexr4f,	7R, FL_LDSCHED, 9e)
 ARM_CORE(cortex-m3,	  cortexm3,	7M, FL_LDSCHED, 9e)



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 22:20:49 UTC 2013

Modified Files:
src/lib/libc/arch/arm: SYS.h

Log Message:
Rework SYSTRAP for thumb.
Add END to PSEUDO_NOERROR and PSEUDO


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/arch/arm/SYS.h

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

Modified files:

Index: src/lib/libc/arch/arm/SYS.h
diff -u src/lib/libc/arch/arm/SYS.h:1.12 src/lib/libc/arch/arm/SYS.h:1.13
--- src/lib/libc/arch/arm/SYS.h:1.12	Thu Aug  1 05:32:33 2013
+++ src/lib/libc/arch/arm/SYS.h	Fri Aug 16 22:20:49 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: SYS.h,v 1.12 2013/08/01 05:32:33 matt Exp $	*/
+/*	$NetBSD: SYS.h,v 1.13 2013/08/16 22:20:49 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -38,12 +38,41 @@
 #include sys/syscall.h
 #include arm/swi.h
 
-#ifdef __STDC__
-#define SYSTRAP(x)	swi SWI_OS_NETBSD | SYS_ ## x
-#else
-#define SYSTRAP(x)	swi SWI_OS_NETBSD | SYS_/**/x
+#ifndef __STDC__
+#error __STDC__ not defined
 #endif
 
+#if !defined(__thumb__)
+#define SYSTRAP(x)	svc #SWI_OS_NETBSD | SYS_ ## x
+#else
+.macro	emitsvc	x
+	mov	ip, r0
+.ifeq	\x / 256
+	movs	r0, #\x
+.else
+#if defined(_ARM_ARCH_7)
+	movw	r0, #\x
+#else
+.ifeq (\x  3)
+	movs	r0, #(\x / 4)
+	lsls	r0, r0, #3
+.else
+.ifeq (\x  1)
+	movs	r0, #(\x / 2)
+	lsls	r0, r0, #1
+.else
+	movs	r0, #(\x / 256)
+	lsls	r0, r0, #8
+	adds	r0, r0, #(\x  255)
+.endif
+.endif
+#endif /* !_ARM_ARCH_7 */
+.endif
+	svc	#255
+.endm
+#define SYSTRAP(x)	emitsvc SYS_ ## x
+#endif /* __thumb__ */
+
 #define	CERROR		_C_LABEL(__cerror)
 #define	CURBRK		_C_LABEL(__curbrk)
 
@@ -51,9 +80,15 @@
 	ENTRY(x);			\
 	SYSTRAP(y)
 
+#if  !defined(__thumb__) || defined(_ARM_ARCH_T2)
+#define	_INVOKE_CERROR()	bcs CERROR
+#else
+#define	_INVOKE_CERROR()	\
+	bcc 86f; push {r4,lr}; bl CERROR; pop {r4,pc}; 86:
+#endif
 #define _SYSCALL(x, y)			\
 	_SYSCALL_NOERROR(x,y);		\
-	bcs CERROR
+	_INVOKE_CERROR()
 
 #define SYSCALL_NOERROR(x)		\
 	_SYSCALL_NOERROR(x,x)
@@ -64,11 +99,13 @@
 
 #define PSEUDO_NOERROR(x,y)		\
 	_SYSCALL_NOERROR(x,y);		\
-	RET
+	RET;\
+	END(x)
 
 #define PSEUDO(x,y)			\
 	_SYSCALL(x,y);			\
-	RET
+	RET;\
+	END(x)
 
 
 #define RSYSCALL_NOERROR(x)		\



CVS commit: src/lib/libc/arch/arm/sys

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 22:21:59 UTC 2013

Modified Files:
src/lib/libc/arch/arm/sys: pipe.S

Log Message:
Use _INVOKE_CERROR
use stmia instead of two str
add END


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/arm/sys/pipe.S

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

Modified files:

Index: src/lib/libc/arch/arm/sys/pipe.S
diff -u src/lib/libc/arch/arm/sys/pipe.S:1.7 src/lib/libc/arch/arm/sys/pipe.S:1.8
--- src/lib/libc/arch/arm/sys/pipe.S:1.7	Thu Aug  1 05:54:24 2013
+++ src/lib/libc/arch/arm/sys/pipe.S	Fri Aug 16 22:21:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pipe.S,v 1.7 2013/08/01 05:54:24 matt Exp $	*/
+/*	$NetBSD: pipe.S,v 1.8 2013/08/16 22:21:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -40,8 +40,8 @@ WEAK_ALIAS(pipe, _pipe)
 ENTRY(_pipe)
 	mov	r2, r0
 	SYSTRAP(pipe)
-	bcs	CERROR
-	str	r0, [r2, #0x]
-	str	r1, [r2, #0x0004]
-	mov	r0, #0x
+	_INVOKE_CERROR()
+	stmia	r2!, {r0-r1}
+	movs	r0, #0
 	RET
+END(_pipe)



CVS commit: src/lib/libc/arch/arm/sys

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 22:28:06 UTC 2013

Modified Files:
src/lib/libc/arch/arm/sys: fork.S

Log Message:
thumbify and add END


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/arm/sys/fork.S

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

Modified files:

Index: src/lib/libc/arch/arm/sys/fork.S
diff -u src/lib/libc/arch/arm/sys/fork.S:1.6 src/lib/libc/arch/arm/sys/fork.S:1.7
--- src/lib/libc/arch/arm/sys/fork.S:1.6	Sat Aug 21 11:30:17 2004
+++ src/lib/libc/arch/arm/sys/fork.S	Fri Aug 16 22:28:05 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fork.S,v 1.6 2004/08/21 11:30:17 rearnsha Exp $	*/
+/*	$NetBSD: fork.S,v 1.7 2013/08/16 22:28:05 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -42,6 +42,7 @@
  */
 
 _SYSCALL(__fork,fork)
-	sub	r1, r1, #1	/* r1 == 0x if parent, 0 if child */
-	and	r0, r0, r1	/* r0 == 0 if child, else unchanged */
+	subs	r1, r1, #1	/* r1 == 0x if parent, 0 if child */
+	ands	r0, r0, r1	/* r0 == 0 if child, else unchanged */
 	RET
+END(__fork)



CVS commit: src/lib/libc/arch/arm/sys

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 22:27:32 UTC 2013

Modified Files:
src/lib/libc/arch/arm/sys: __vfork14.S

Log Message:
Thumbify  optimize a little


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/arm/sys/__vfork14.S

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

Modified files:

Index: src/lib/libc/arch/arm/sys/__vfork14.S
diff -u src/lib/libc/arch/arm/sys/__vfork14.S:1.8 src/lib/libc/arch/arm/sys/__vfork14.S:1.9
--- src/lib/libc/arch/arm/sys/__vfork14.S:1.8	Thu Aug  1 05:54:24 2013
+++ src/lib/libc/arch/arm/sys/__vfork14.S	Fri Aug 16 22:27:32 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: __vfork14.S,v 1.8 2013/08/01 05:54:24 matt Exp $	*/
+/*	$NetBSD: __vfork14.S,v 1.9 2013/08/16 22:27:32 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -44,10 +44,10 @@
 	.align	0
 
 ENTRY(__vfork14)
-	mov	r2, r14
+	mov	r2, lr
 	SYSTRAP(__vfork14)
-	bcs	CERROR
-	mov	r14, r2
-	sub	r1, r1, #1	/* r1 == 0x if parent, 0 if child */
-	and	r0, r0, r1	/* r0 == 0 if child, else unchanged */
-	RET
+	_INVOKE_CERROR()
+	subs	r1, r1, #1	/* r1 == 0x if parent, 0 if child */
+	ands	r0, r0, r1	/* r0 == 0 if child, else unchanged */
+	RETr(r2)
+END(__vfork14)



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 22:30:28 UTC 2013

Modified Files:
src/lib/libc/arch/arm: SYS.h

Log Message:
Save r3 instead of r4 when calling CERROR in thumb mode.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/arm/SYS.h

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

Modified files:

Index: src/lib/libc/arch/arm/SYS.h
diff -u src/lib/libc/arch/arm/SYS.h:1.13 src/lib/libc/arch/arm/SYS.h:1.14
--- src/lib/libc/arch/arm/SYS.h:1.13	Fri Aug 16 22:20:49 2013
+++ src/lib/libc/arch/arm/SYS.h	Fri Aug 16 22:30:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: SYS.h,v 1.13 2013/08/16 22:20:49 matt Exp $	*/
+/*	$NetBSD: SYS.h,v 1.14 2013/08/16 22:30:28 matt Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -84,7 +84,7 @@
 #define	_INVOKE_CERROR()	bcs CERROR
 #else
 #define	_INVOKE_CERROR()	\
-	bcc 86f; push {r4,lr}; bl CERROR; pop {r4,pc}; 86:
+	bcc 86f; push {r3,lr}; bl CERROR; pop {r3,pc}; 86:
 #endif
 #define _SYSCALL(x, y)			\
 	_SYSCALL_NOERROR(x,y);		\



CVS commit: src/lib/libc/arch/arm/sys

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Aug 16 23:20:59 UTC 2013

Modified Files:
src/lib/libc/arch/arm/sys: __sigtramp2.S

Log Message:
Add END


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/arm/sys/__sigtramp2.S

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

Modified files:

Index: src/lib/libc/arch/arm/sys/__sigtramp2.S
diff -u src/lib/libc/arch/arm/sys/__sigtramp2.S:1.2 src/lib/libc/arch/arm/sys/__sigtramp2.S:1.3
--- src/lib/libc/arch/arm/sys/__sigtramp2.S:1.2	Mon Apr 28 20:22:55 2008
+++ src/lib/libc/arch/arm/sys/__sigtramp2.S	Fri Aug 16 23:20:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.2 2008/04/28 20:22:55 martin Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.3 2013/08/16 23:20:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -47,3 +47,4 @@ ENTRY_NP(__sigtramp_siginfo_2)
 
 	/* If that failed, exit with the error code. */
 	SYSTRAP(exit)
+END(__sigtramp_siginfo_2)



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 17 00:21:47 UTC 2013

Modified Files:
src/sys/arch/arm/include: cdefs.h

Log Message:
Add _ARM_ARCH_5T (needed for blx reg support)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/include/cdefs.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/include/cdefs.h
diff -u src/sys/arch/arm/include/cdefs.h:1.8 src/sys/arch/arm/include/cdefs.h:1.9
--- src/sys/arch/arm/include/cdefs.h:1.8	Thu Aug 15 22:25:10 2013
+++ src/sys/arch/arm/include/cdefs.h	Sat Aug 17 00:21:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.8 2013/08/15 22:25:10 matt Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.9 2013/08/17 00:21:47 matt Exp $	*/
 
 #ifndef	_ARM_CDEFS_H_
 #define	_ARM_CDEFS_H_
@@ -20,9 +20,12 @@
 #define _ARM_ARCH_6
 #endif
 
-#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5__) || \
-defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5TE__) || \
-defined (__ARM_ARCH_5TEJ__)
+#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5T__) || \
+defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
+#define _ARM_ARCH_5T
+#endif
+
+#if defined (_ARM_ARCH_6) || defined (_ARM_ARCH_5T) || defined (__ARM_ARCH_5__)
 #define _ARM_ARCH_5
 #endif
 



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 17 00:40:10 UTC 2013

Modified Files:
src/sys/arch/arm/omap: am335x_prcm.c

Log Message:
inject a PMFE_SPEED_CHANGED when changing the speed.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/am335x_prcm.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/omap/am335x_prcm.c
diff -u src/sys/arch/arm/omap/am335x_prcm.c:1.5 src/sys/arch/arm/omap/am335x_prcm.c:1.6
--- src/sys/arch/arm/omap/am335x_prcm.c:1.5	Thu Aug  1 00:24:43 2013
+++ src/sys/arch/arm/omap/am335x_prcm.c	Sat Aug 17 00:40:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: am335x_prcm.c,v 1.5 2013/08/01 00:24:43 matt Exp $	*/
+/*	$NetBSD: am335x_prcm.c,v 1.6 2013/08/17 00:40:10 matt Exp $	*/
 
 /*
  * TI OMAP Power, Reset, and Clock Management on the AM335x
@@ -34,11 +34,12 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: am335x_prcm.c,v 1.5 2013/08/01 00:24:43 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: am335x_prcm.c,v 1.6 2013/08/17 00:40:10 matt Exp $);
 
 #include sys/types.h
 #include sys/param.h
 #include sys/sysctl.h
+#include sys/pmf.h
 
 #include arm/omap/am335x_prcm.h
 #include arm/omap/omap2_reg.h
@@ -178,6 +179,7 @@ mpu_current_frequency_sysctl_helper(SYSC
 		aprint_normal_dev(curcpu()-ci_dev,
 		frequency changed from %d MHz to %d MHz\n,
 		old_freq, freq);
+		pmf_event_inject(NULL, PMFE_SPEED_CHANGED);
 	}
 
 	return 0;



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

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 17 01:07:45 UTC 2013

Modified Files:
src/lib/libc/arch/arm/gen: alloca.S

Log Message:
Thumbify  add END


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/arm/gen/alloca.S

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

Modified files:

Index: src/lib/libc/arch/arm/gen/alloca.S
diff -u src/lib/libc/arch/arm/gen/alloca.S:1.4 src/lib/libc/arch/arm/gen/alloca.S:1.5
--- src/lib/libc/arch/arm/gen/alloca.S:1.4	Sat Aug 21 11:20:10 2004
+++ src/lib/libc/arch/arm/gen/alloca.S	Sat Aug 17 01:07:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: alloca.S,v 1.4 2004/08/21 11:20:10 rearnsha Exp $	*/
+/*	$NetBSD: alloca.S,v 1.5 2013/08/17 01:07:45 matt Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe
@@ -37,8 +37,17 @@
 #include machine/asm.h
 
 ENTRY(alloca)
-	add	r0, r0, #0x0007	/* round up to next 8 byte alignment */
-	bic	r0, r0, #0x0007
-	sub	sp, sp, r0		/* Adjust the stack pointer */
-	mov	r0, sp			/* r0 = base of new space */
+	adds	r0, r0, #7	/* round up to next 8 byte alignment */
+#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
+	bics	r0, r0, #7
+	sub	sp, sp, r0	/* Adjust the stack pointer */
+	mov	r0, sp		/* r0 = base of new space */
+#else
+	lsrs	r0, r0, #3
+	lsls	r0, r0, #3
+	mov	r1, sp
+	subs	r0, r1, r0	/* Adjust the stack pointer */
+	mov	sp, r0		/* r0 = base of new space */
+#endif
 	RET
+END(alloca)



CVS commit: src/lib/libc/arch/arm/sys

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 17 01:08:35 UTC 2013

Modified Files:
src/lib/libc/arch/arm/sys: __aeabi_read_tp.S

Log Message:
Enforce that this must be not compiled using Thumb1


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/arm/sys/__aeabi_read_tp.S

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

Modified files:

Index: src/lib/libc/arch/arm/sys/__aeabi_read_tp.S
diff -u src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.3 src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.4
--- src/lib/libc/arch/arm/sys/__aeabi_read_tp.S:1.3	Tue Nov 20 22:02:46 2012
+++ src/lib/libc/arch/arm/sys/__aeabi_read_tp.S	Sat Aug 17 01:08:35 2013
@@ -1,7 +1,11 @@
-/* $NetBSD: __aeabi_read_tp.S,v 1.3 2012/11/20 22:02:46 matt Exp $ */
+/* $NetBSD: __aeabi_read_tp.S,v 1.4 2013/08/17 01:08:35 matt Exp $ */
 
 #include SYS.h
 
+#if defined(__thumb__)  !defined(_ARM_ARCH_T2)
+#error Thumb only supported on armv7
+#endif
+
 /*
  * Implementations of this function should corrupt only the result register
  * (r0) and the non-parameter integer core registers allowed to be corrupted
@@ -17,4 +21,4 @@ ENTRY(__aeabi_read_tp)
 	mov	r1, ip			/* restore r1 */
 #endif
 	RET
-_END(__aeabi_read_tp)
+END(__aeabi_read_tp)



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 17 05:42:07 UTC 2013

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: arm.h

Log Message:
If hardware divide is supported on the CPU, predefine __ARM_ARCH_EXT_IDIV__


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/config/arm/arm.h

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/dist/gcc/config/arm/arm.h
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/arm.h:1.3 src/external/gpl3/gcc/dist/gcc/config/arm/arm.h:1.4
--- src/external/gpl3/gcc/dist/gcc/config/arm/arm.h:1.3	Fri Jan 25 08:31:43 2013
+++ src/external/gpl3/gcc/dist/gcc/config/arm/arm.h	Sat Aug 17 05:42:06 2013
@@ -100,6 +100,8 @@ extern char arm_arch_name[];
 	if (TARGET_HARD_FLOAT  TARGET_VFP)	\
 	  builtin_define (__ARM_PCS_VFP);		\
 	  }		\
+	if (TARGET_IDIV)\
+	  builtin_define (__ARM_ARCH_EXT_IDIV__);	\
 } while (0)
 
 /* The various ARM cores.  */
@@ -269,6 +271,8 @@ extern void (*arm_lang_output_object_att
for Thumb-2.  */
 #define TARGET_UNIFIED_ASM TARGET_THUMB2
 
+/* Nonzero if integer division instructions supported.  */
+#define TARGET_IDIV (arm_arch_hwdiv)
 
 /* True iff the full BPABI is being used.  If TARGET_BPABI is true,
then TARGET_AAPCS_BASED must be true -- but the converse does not



CVS commit: src/external/gpl3/gcc/dist/gcc/config/arm

2013-08-16 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Aug 17 05:43:02 UTC 2013

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/arm: thumb2.md

Log Message:
Enable sdiv/udiv instructions for both Thumb2 and ARM if hwdiv is supported.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl3/gcc/dist/gcc/config/arm/thumb2.md

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/dist/gcc/config/arm/thumb2.md
diff -u src/external/gpl3/gcc/dist/gcc/config/arm/thumb2.md:1.1.1.2 src/external/gpl3/gcc/dist/gcc/config/arm/thumb2.md:1.2
--- src/external/gpl3/gcc/dist/gcc/config/arm/thumb2.md:1.1.1.2	Tue Sep 18 06:15:28 2012
+++ src/external/gpl3/gcc/dist/gcc/config/arm/thumb2.md	Sat Aug 17 05:43:02 2013
@@ -1208,7 +1208,7 @@
   [(set (match_operand:SI	  0 s_register_operand =r)
 	(div:SI (match_operand:SI 1 s_register_operand  r)
 		(match_operand:SI 2 s_register_operand  r)))]
-  TARGET_THUMB2  arm_arch_hwdiv
+  (TARGET_THUMB2 || TARGET_ARM)  arm_arch_hwdiv
   sdiv%?\t%0, %1, %2
   [(set_attr predicable yes)
(set_attr insn sdiv)]
@@ -1218,7 +1218,7 @@
   [(set (match_operand:SI	   0 s_register_operand =r)
 	(udiv:SI (match_operand:SI 1 s_register_operand  r)
 		 (match_operand:SI 2 s_register_operand  r)))]
-  TARGET_THUMB2  arm_arch_hwdiv
+  (TARGET_THUMB2 || TARGET_ARM)  arm_arch_hwdiv
   udiv%?\t%0, %1, %2
   [(set_attr predicable yes)
(set_attr insn udiv)]