CVS commit: src/lib/libc/arch/powerpc/string

2021-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jul 24 05:27:26 UTC 2021

Modified Files:
src/lib/libc/arch/powerpc/string: Makefile.inc

Log Message:
For evbppc, use C version of bcopy(3), memcpy(3), memcmp(3), and
memmove(3) consistently for debug library (*.go) in order to avoid
alignment faults for 403.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/powerpc/string/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/powerpc/string/Makefile.inc
diff -u src/lib/libc/arch/powerpc/string/Makefile.inc:1.13 src/lib/libc/arch/powerpc/string/Makefile.inc:1.14
--- src/lib/libc/arch/powerpc/string/Makefile.inc:1.13	Sun Mar 14 00:26:10 2010
+++ src/lib/libc/arch/powerpc/string/Makefile.inc	Sat Jul 24 05:27:25 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2010/03/14 00:26:10 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2021/07/24 05:27:25 rin Exp $
 
 SRCS+=  bzero.S ffs.S strlen.S
 NO_SRCS+= memset.S
@@ -7,18 +7,11 @@ NO_SRCS+= memset.S
 # the special rules here are to override the suffix rules which seem
 # to prefer .S files over .c
 .if ${MACHINE} == "evbppc"
-bcopy.o: bcopy.c
-bcopy.po: bcopy.c
-bcopy.pico: bcopy.c
-memcpy.o: memcpy.c
-memcpy.po: memcpy.c
-memcpy.pico: memcpy.c
-memcmp.o: memcmp.c
-memcmp.po: memcmp.c
-memcmp.pico: memcmp.c
-memmove.o: memmove.c
-memmove.po: memmove.c
-memmove.pico: memmove.c
+.  for name in bcopy memcmp memcpy memmove
+.for suffix in o po pico go
+${name}.${suffix}: ${name}.c
+.endfor
+.  endfor
 .else
 SRCS+=	memcmp.S bcopy.S memcpy.S memmove.S
 .endif



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

2021-06-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 30 21:20:30 UTC 2021

Modified Files:
src/lib/libc/arch/arm/gen: swapcontext.S
src/lib/libc/arch/arm/sys: __clone.S

Log Message:
Do previous differtly by pushing two registers in the same way as the
_INVOKE_CERROR macro


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/arm/gen/swapcontext.S
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/arm/sys/__clone.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/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.17 src/lib/libc/arch/arm/gen/swapcontext.S:1.18
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.17	Wed Jun 30 00:00:49 2021
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Wed Jun 30 21:20:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.17 2021/06/30 00:00:49 rin Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.18 2021/06/30 21:20:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.17 2021/06/30 00:00:49 rin Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.18 2021/06/30 21:20:29 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
@@ -84,15 +84,9 @@ ENTRY(swapcontext)
 #if !defined(__thumb__) || defined(_ARM_ARCH_T2)
 	b	PLT_SYM(_C_LABEL(setcontext))
 #else
-	push	{lr}
-	mov	r1, sp
-	subs	r1, #4
-	mov	sp, r1
+	push	{r3, lr}
 	bl	PLT_SYM(_C_LABEL(setcontext))
-	mov	r1, sp
-	adds	r1, #4
-	mov	sp, r1
-	pop	{pc}
+	pop	{r3, pc}
 #endif
 #if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)
 	.cfi_endproc

Index: src/lib/libc/arch/arm/sys/__clone.S
diff -u src/lib/libc/arch/arm/sys/__clone.S:1.13 src/lib/libc/arch/arm/sys/__clone.S:1.14
--- src/lib/libc/arch/arm/sys/__clone.S:1.13	Wed Jun 30 07:36:05 2021
+++ src/lib/libc/arch/arm/sys/__clone.S	Wed Jun 30 21:20:30 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.13 2021/06/30 07:36:05 skrll Exp $ */
+/* $NetBSD: __clone.S,v 1.14 2021/06/30 21:20:30 skrll Exp $ */
 
 /*
  * Copyright (c) 2001 Christopher Gilbert
@@ -117,14 +117,8 @@ ENTRY(__clone)
 	b	CERROR
 #else
 .Lcerror:
-	push	{lr}
-	mov	r1, sp
-	subs	r1, #4
-	mov	sp, r1
+	push	{r3, lr}
 	bl	CERROR
-	mov	r1, sp
-	adds	r1, #4
-	mov	sp, r1
-	pop	{pc}
+	pop	{r3, pc}
 #endif
 END(__clone)



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

2021-06-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 30 07:36:05 UTC 2021

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

Log Message:
The _INVOKE_CERROR macro deals with thumb so simplify the code (at the
expense of a couple more instructions).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/arch/arm/sys/__clone.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/__clone.S
diff -u src/lib/libc/arch/arm/sys/__clone.S:1.12 src/lib/libc/arch/arm/sys/__clone.S:1.13
--- src/lib/libc/arch/arm/sys/__clone.S:1.12	Wed Jun 30 07:34:24 2021
+++ src/lib/libc/arch/arm/sys/__clone.S	Wed Jun 30 07:36:05 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.12 2021/06/30 07:34:24 skrll Exp $ */
+/* $NetBSD: __clone.S,v 1.13 2021/06/30 07:36:05 skrll Exp $ */
 
 /*
  * Copyright (c) 2001 Christopher Gilbert
@@ -65,11 +65,7 @@ ENTRY(__clone)
 	mov	r0, r2
 
 	SYSTRAP(__clone)
-#if !defined(__thumb__) || defined(_ARM_ARCH_T2)
 	_INVOKE_CERROR()
-#else
-	bcs	.Lcerror
-#endif
 
 	/*
 	 * r1 and r0 are the same as from fork:



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

2021-06-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jun 30 07:34:24 UTC 2021

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/arm/sys/__clone.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/__clone.S
diff -u src/lib/libc/arch/arm/sys/__clone.S:1.11 src/lib/libc/arch/arm/sys/__clone.S:1.12
--- src/lib/libc/arch/arm/sys/__clone.S:1.11	Wed Jun 30 00:00:49 2021
+++ src/lib/libc/arch/arm/sys/__clone.S	Wed Jun 30 07:34:24 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.11 2021/06/30 00:00:49 rin Exp $ */
+/* $NetBSD: __clone.S,v 1.12 2021/06/30 07:34:24 skrll Exp $ */
 
 /*
  * Copyright (c) 2001 Christopher Gilbert
@@ -55,12 +55,12 @@ ENTRY(__clone)
 
 	/* place the func and its arg onto the child's stack */
 #if !defined(__thumb__) || defined(_ARM_ARCH_T2)
-	stmfd	r1!, {r0, r3} 
+	stmfd	r1!, {r0, r3}
 #else
 	subs	r1, r1, #8
-	stmia	r1!, {r0, r3} 
+	stmia	r1!, {r0, r3}
 #endif
-	
+
 	/* syscall expects (flags, stack) */
 	mov	r0, r2
 



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

2021-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Jun 30 00:00:49 UTC 2021

Modified Files:
src/lib/libc/arch/arm/gen: swapcontext.S
src/lib/libc/arch/arm/sys: __clone.S

Log Message:
Fix previous. For Thumb-1:
- sp cannot be manipulated directly
- {add,sub}s should be used instead of {add,sub}


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/arch/arm/gen/swapcontext.S
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/arm/sys/__clone.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/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.16 src/lib/libc/arch/arm/gen/swapcontext.S:1.17
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.16	Tue Jun 29 23:29:12 2021
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Wed Jun 30 00:00:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.16 2021/06/29 23:29:12 rin Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.17 2021/06/30 00:00:49 rin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.16 2021/06/29 23:29:12 rin Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.17 2021/06/30 00:00:49 rin Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
@@ -85,9 +85,13 @@ ENTRY(swapcontext)
 	b	PLT_SYM(_C_LABEL(setcontext))
 #else
 	push	{lr}
-	sub	sp, #4
+	mov	r1, sp
+	subs	r1, #4
+	mov	sp, r1
 	bl	PLT_SYM(_C_LABEL(setcontext))
-	add	sp, #4
+	mov	r1, sp
+	adds	r1, #4
+	mov	sp, r1
 	pop	{pc}
 #endif
 #if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)

Index: src/lib/libc/arch/arm/sys/__clone.S
diff -u src/lib/libc/arch/arm/sys/__clone.S:1.10 src/lib/libc/arch/arm/sys/__clone.S:1.11
--- src/lib/libc/arch/arm/sys/__clone.S:1.10	Tue Jun 29 23:29:12 2021
+++ src/lib/libc/arch/arm/sys/__clone.S	Wed Jun 30 00:00:49 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.10 2021/06/29 23:29:12 rin Exp $ */
+/* $NetBSD: __clone.S,v 1.11 2021/06/30 00:00:49 rin Exp $ */
 
 /*
  * Copyright (c) 2001 Christopher Gilbert
@@ -122,9 +122,13 @@ ENTRY(__clone)
 #else
 .Lcerror:
 	push	{lr}
-	sub	sp, #4
+	mov	r1, sp
+	subs	r1, #4
+	mov	sp, r1
 	bl	CERROR
-	add	sp, #4
+	mov	r1, sp
+	adds	r1, #4
+	mov	sp, r1
 	pop	{pc}
 #endif
 END(__clone)



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

2021-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 29 23:29:12 UTC 2021

Modified Files:
src/lib/libc/arch/arm/gen: swapcontext.S
src/lib/libc/arch/arm/sys: __clone.S

Log Message:
Align sp to 8-byte boundary as required by EABI.

IIUC, this change only affects libc compiled for ``Thumb-mode userland'',
which we've not officially supported yet.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/lib/libc/arch/arm/gen/swapcontext.S
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/arm/sys/__clone.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/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.15 src/lib/libc/arch/arm/gen/swapcontext.S:1.16
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.15	Wed Nov 21 21:01:41 2018
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Tue Jun 29 23:29:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.16 2021/06/29 23:29:12 rin Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.16 2021/06/29 23:29:12 rin Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
@@ -85,7 +85,9 @@ ENTRY(swapcontext)
 	b	PLT_SYM(_C_LABEL(setcontext))
 #else
 	push	{lr}
+	sub	sp, #4
 	bl	PLT_SYM(_C_LABEL(setcontext))
+	add	sp, #4
 	pop	{pc}
 #endif
 #if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__)

Index: src/lib/libc/arch/arm/sys/__clone.S
diff -u src/lib/libc/arch/arm/sys/__clone.S:1.9 src/lib/libc/arch/arm/sys/__clone.S:1.10
--- src/lib/libc/arch/arm/sys/__clone.S:1.9	Sat Nov 30 20:20:42 2013
+++ src/lib/libc/arch/arm/sys/__clone.S	Tue Jun 29 23:29:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.9 2013/11/30 20:20:42 joerg Exp $ */
+/* $NetBSD: __clone.S,v 1.10 2021/06/29 23:29:12 rin Exp $ */
 
 /*
  * Copyright (c) 2001 Christopher Gilbert
@@ -122,7 +122,9 @@ ENTRY(__clone)
 #else
 .Lcerror:
 	push	{lr}
+	sub	sp, #4
 	bl	CERROR
+	add	sp, #4
 	pop	{pc}
 #endif
 END(__clone)



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

2021-04-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Apr 25 23:45:58 UTC 2021

Modified Files:
src/lib/libc/arch/mips: Makefile.inc
src/lib/libc/arch/mips/gdtoa: Makefile.inc

Log Message:
Use ${MACHINE_MIPS64}


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/mips/Makefile.inc
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/mips/gdtoa/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/mips/Makefile.inc
diff -u src/lib/libc/arch/mips/Makefile.inc:1.14 src/lib/libc/arch/mips/Makefile.inc:1.15
--- src/lib/libc/arch/mips/Makefile.inc:1.14	Sun Jan 24 10:55:34 2016
+++ src/lib/libc/arch/mips/Makefile.inc	Sun Apr 25 19:45:58 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.14 2016/01/24 15:55:34 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.15 2021/04/25 23:45:58 christos Exp $
 
 .include 
 
@@ -14,13 +14,11 @@ CPPFLAGS+= -DSOFTFLOAT
 
 SRCS+=	fixunsgen_ieee754.c
 SRCS+=	fixunsgen64_ieee754.c #fixunssfdi.c fixunsdfdi.c
-.if (${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el") \
-&& (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
+.if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
 SRCS+=	fixunstfsi_ieee754.c fixunstfdi_ieee754.c
 .endif
 .endif
 
-.if (${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el") \
-&& (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
+.if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
 SRCS+=	floatunditf_ieee754.c
 .endif

Index: src/lib/libc/arch/mips/gdtoa/Makefile.inc
diff -u src/lib/libc/arch/mips/gdtoa/Makefile.inc:1.4 src/lib/libc/arch/mips/gdtoa/Makefile.inc:1.5
--- src/lib/libc/arch/mips/gdtoa/Makefile.inc:1.4	Thu Jan 20 13:41:39 2011
+++ src/lib/libc/arch/mips/gdtoa/Makefile.inc	Sun Apr 25 19:45:58 2021
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.4 2011/01/20 18:41:39 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.5 2021/04/25 23:45:58 christos Exp $
 
 SRCS+=	strtof.c
-.if (${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el")
+.if ${MACHINE_MIPS64}
 .if !defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32)
 SRCS+=	strtold_pQ.c
 SRCS+=	strtopQ.c



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

2021-02-19 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Fri Feb 19 08:33:02 UTC 2021

Modified Files:
src/lib/libc/arch/mips/sys: __syscall.S

Log Message:
Remove the incorrect register shuffle - we pass SYS___syscall as the
syscall number in v0 and pass all the original __syscall() args in their
original slots/regs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/mips/sys/__syscall.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/mips/sys/__syscall.S
diff -u src/lib/libc/arch/mips/sys/__syscall.S:1.3 src/lib/libc/arch/mips/sys/__syscall.S:1.4
--- src/lib/libc/arch/mips/sys/__syscall.S:1.3	Sat Apr 18 23:55:51 2020
+++ src/lib/libc/arch/mips/sys/__syscall.S	Fri Feb 19 08:33:02 2021
@@ -1,31 +1,10 @@
-/*	$NetBSD: __syscall.S,v 1.3 2020/04/18 23:55:51 thorpej Exp $	*/
+/*	$NetBSD: __syscall.S,v 1.4 2021/02/19 08:33:02 simonb Exp $	*/
 
 #include "SYS.h"
 
-#ifdef __mips_o32
-
 RSYSCALL(__syscall)
 
-#else /* ! __mips_o32 */
-
-LEAF(__syscall)
-PIC_PROLOGUE(__syscall)
-	move	v0, a0
-	move	a0, a1
-	move	a1, a2
-	move	a2, a3
-	move	a3, a4
-	move	a4, a5
-	move	a5, a6
-	move	a6, a7
-	REG_L	a7, (sp)
-SYSTRAP(__syscall)
-bne a3,zero,1f
-PIC_RETURN()
-1:
-PIC_TAILCALL(__cerror)
-END(__syscall)
+#ifndef __mips_o32
 STRONG_ALIAS(_syscall,__syscall)
 WEAK_ALIAS(syscall,__syscall)
-
-#endif /* __mips_o32 */
+#endif /* ! __mips_o32 */



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

2021-02-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Feb  6 06:58:59 UTC 2021

Modified Files:
src/lib/libc/arch/mips/sys: cerror.S

Log Message:
For mips n32/n64 explicitly save the GP reg on the stack, and
restore it _after_ the call to __errno().  Fixes sending the
__errno() call off to nowhereland when this code is included
in another library (eg __posix_cerror() in libposix).  Failure
picked up by the ATF lib/libposix/posix1/t_rename test.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/lib/libc/arch/mips/sys/cerror.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/mips/sys/cerror.S
diff -u src/lib/libc/arch/mips/sys/cerror.S:1.19 src/lib/libc/arch/mips/sys/cerror.S:1.20
--- src/lib/libc/arch/mips/sys/cerror.S:1.19	Thu Sep 12 15:36:15 2013
+++ src/lib/libc/arch/mips/sys/cerror.S	Sat Feb  6 06:58:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cerror.S,v 1.19 2013/09/12 15:36:15 joerg Exp $	*/
+/*	$NetBSD: cerror.S,v 1.20 2021/02/06 06:58:59 simonb Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 	RCSID("from: @(#)cerror.s	8.1 (Berkeley) 6/16/93")
 #else
-	RCSID("$NetBSD: cerror.S,v 1.19 2013/09/12 15:36:15 joerg Exp $")
+	RCSID("$NetBSD: cerror.S,v 1.20 2021/02/06 06:58:59 simonb Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -50,24 +50,33 @@
 	.globl	_C_LABEL(__errno)
 NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra)
 	.mask	0x8000, (CALLFRAME_RA - CALLFRAME_SIZ)
-	PIC_PROLOGUE(__cerror)
+	PIC_PROLOGUE(__cerror)		# saves caller gp in t3 (n32/n64)
 	PTR_SUBU	sp, CALLFRAME_SIZ
 	PTR_S		ra, CALLFRAME_RA(sp)
 	INT_S		v0, CALLFRAME_S0(sp)	# save errno value
+#if defined(__mips_n32) || defined(__mips_n64)
+	PTR_S		t3, CALLFRAME_GP(sp)	# save caller gp (in t3)
+#endif
 
 	SAVE_GP(CALLFRAME_GP)
 
 	PTR_LA		t9, _C_LABEL(__errno)	# locate address of errno
-	RESTORE_GP64# restore GP (from t3)
+
 	jalr		t9			# __errno()
 
+#if defined(__mips_n32) || defined(__mips_n64)
+	PTR_L		gp, CALLFRAME_GP(sp)	# restore caller gp
+#endif
 	INT_L		t0, CALLFRAME_S0(sp)
 	PTR_L		ra, CALLFRAME_RA(sp)
 	INT_S		t0, 0(v0)		# update errno value
 	PTR_ADDU	sp, CALLFRAME_SIZ
 	li		v0, -1
 	li		v1, -1
-	j		ra			# GP has been restored.
+
+	# Note we don't use PIC_RETURN() here as the GP is stored
+	# on the stack and not in the t3 reg (for the n32/n64 case).
+	j		ra
 END(__cerror)
 #else		
 	.globl	_C_LABEL(errno)



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

2020-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 24 07:05:52 UTC 2020

Modified Files:
src/lib/libc/arch/hppa: genassym.cf

Log Message:
Add _UC_GREGS_* defines for all general registers


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/hppa/genassym.cf

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/hppa/genassym.cf
diff -u src/lib/libc/arch/hppa/genassym.cf:1.2 src/lib/libc/arch/hppa/genassym.cf:1.3
--- src/lib/libc/arch/hppa/genassym.cf:1.2	Thu Oct 15 05:43:38 2020
+++ src/lib/libc/arch/hppa/genassym.cf	Sat Oct 24 07:05:52 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.2 2020/10/15 05:43:38 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.3 2020/10/24 07:05:52 skrll Exp $
 
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -37,3 +37,34 @@ define _REG_PCOQT	_REG_PCOQT
 define _REG_RET0	_REG_RET0
 
 define _UC_GREGS	offsetof(ucontext_t, uc_mcontext.__gregs[0])
+define _UC_GREGS_R1	offsetof(ucontext_t, uc_mcontext.__gregs[1])
+define _UC_GREGS_R2	offsetof(ucontext_t, uc_mcontext.__gregs[2])
+define _UC_GREGS_R3	offsetof(ucontext_t, uc_mcontext.__gregs[3])
+define _UC_GREGS_R4	offsetof(ucontext_t, uc_mcontext.__gregs[4])
+define _UC_GREGS_R5	offsetof(ucontext_t, uc_mcontext.__gregs[5])
+define _UC_GREGS_R6	offsetof(ucontext_t, uc_mcontext.__gregs[6])
+define _UC_GREGS_R7	offsetof(ucontext_t, uc_mcontext.__gregs[7])
+define _UC_GREGS_R8	offsetof(ucontext_t, uc_mcontext.__gregs[8])
+define _UC_GREGS_R9	offsetof(ucontext_t, uc_mcontext.__gregs[9])
+define _UC_GREGS_R10	offsetof(ucontext_t, uc_mcontext.__gregs[10])
+define _UC_GREGS_R11	offsetof(ucontext_t, uc_mcontext.__gregs[11])
+define _UC_GREGS_R12	offsetof(ucontext_t, uc_mcontext.__gregs[12])
+define _UC_GREGS_R13	offsetof(ucontext_t, uc_mcontext.__gregs[13])
+define _UC_GREGS_R14	offsetof(ucontext_t, uc_mcontext.__gregs[14])
+define _UC_GREGS_R15	offsetof(ucontext_t, uc_mcontext.__gregs[15])
+define _UC_GREGS_R16	offsetof(ucontext_t, uc_mcontext.__gregs[16])
+define _UC_GREGS_R17	offsetof(ucontext_t, uc_mcontext.__gregs[17])
+define _UC_GREGS_R18	offsetof(ucontext_t, uc_mcontext.__gregs[18])
+define _UC_GREGS_R19	offsetof(ucontext_t, uc_mcontext.__gregs[19])
+define _UC_GREGS_R20	offsetof(ucontext_t, uc_mcontext.__gregs[20])
+define _UC_GREGS_R21	offsetof(ucontext_t, uc_mcontext.__gregs[21])
+define _UC_GREGS_R22	offsetof(ucontext_t, uc_mcontext.__gregs[22])
+define _UC_GREGS_R23	offsetof(ucontext_t, uc_mcontext.__gregs[23])
+define _UC_GREGS_R24	offsetof(ucontext_t, uc_mcontext.__gregs[24])
+define _UC_GREGS_R25	offsetof(ucontext_t, uc_mcontext.__gregs[25])
+define _UC_GREGS_R26	offsetof(ucontext_t, uc_mcontext.__gregs[26])
+define _UC_GREGS_R27	offsetof(ucontext_t, uc_mcontext.__gregs[27])
+define _UC_GREGS_R28	offsetof(ucontext_t, uc_mcontext.__gregs[28])
+define _UC_GREGS_R29	offsetof(ucontext_t, uc_mcontext.__gregs[29])
+define _UC_GREGS_R30	offsetof(ucontext_t, uc_mcontext.__gregs[30])
+define _UC_GREGS_R31	offsetof(ucontext_t, uc_mcontext.__gregs[31])



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

2020-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 24 07:03:12 UTC 2020

Modified Files:
src/lib/libc/arch/arm: genassym.cf

Log Message:
Provide _UC_REGS_* defines for all registers


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

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/genassym.cf
diff -u src/lib/libc/arch/arm/genassym.cf:1.2 src/lib/libc/arch/arm/genassym.cf:1.3
--- src/lib/libc/arch/arm/genassym.cf:1.2	Tue Apr 30 12:24:31 2013
+++ src/lib/libc/arch/arm/genassym.cf	Sat Oct 24 07:03:11 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.2 2013/04/30 12:24:31 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.3 2020/10/24 07:03:11 skrll Exp $
 
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,5 +33,18 @@ include 
 include 
 
 define _UC_REGS_R0	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R0])
+define _UC_REGS_R1	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R1])
+define _UC_REGS_R2	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R2])
+define _UC_REGS_R3	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R3])
+define _UC_REGS_R4	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R4])
+define _UC_REGS_R5	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R5])
+define _UC_REGS_R6	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R6])
+define _UC_REGS_R7	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R7])
+define _UC_REGS_R8	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R8])
+define _UC_REGS_R9	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R9])
+define _UC_REGS_R10	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R10])
+define _UC_REGS_R11	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R11])
+define _UC_REGS_R12	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R12])
 define _UC_REGS_SP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
+define _UC_REGS_LR	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_LR])
 define _UC_REGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])



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

2020-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 24 07:02:20 UTC 2020

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

Log Message:
Update the unwinder comment to better reflect ARM64


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/aarch64/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/aarch64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.5 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.6
--- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.5	Sat Oct 24 07:00:26 2020
+++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S	Sat Oct 24 07:02:20 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __sigtramp2.S,v 1.5 2020/10/24 07:00:26 skrll Exp $ */
+/* $NetBSD: __sigtramp2.S,v 1.6 2020/10/24 07:02:20 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -41,12 +41,13 @@
  *		ucontext structure
  *	sp->	siginfo structure
  * and x28 points to the ucontext
- *
- * The unwind entry includes the one byte prior to the trampoline
+ */
+
+/*
+ * The unwind entry includes the one instruction prior to the trampoline
  * because the unwinder will look up (return PC - 1) while unwinding.
- * Normally (return PC - 1) computes an address inside the call
- * instruction that created the child frame, but here there is no call
- * instruction so we have to manually add padding.
+ * Normally this would be the jump / branch, but since there isn't one in
+ * this case, we place an explicit nop there instead.
  */
 	.cfi_startproc simple
 	.cfi_signal_frame



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

2020-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 24 07:00:26 UTC 2020

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

Log Message:
s/ARM/ARM64/ in comment


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/aarch64/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/aarch64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.4 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.5
--- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.4	Mon Oct 19 22:33:53 2020
+++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S	Sat Oct 24 07:00:26 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __sigtramp2.S,v 1.4 2020/10/19 22:33:53 kamil Exp $ */
+/* $NetBSD: __sigtramp2.S,v 1.5 2020/10/24 07:00:26 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 /*
- * The ARM signal trampoline is invoked only to return from
+ * The ARM64 signal trampoline is invoked only to return from
  * the signal; the kernel calls the signal handler directly.
  *
  * On entry, the stack looks like:



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

2020-10-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 21 01:58:30 UTC 2020

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

Log Message:
Fix typo (thanks kamil@ for pointing it out).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/alpha/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/alpha/sys/__sigtramp2.S
diff -u src/lib/libc/arch/alpha/sys/__sigtramp2.S:1.4 src/lib/libc/arch/alpha/sys/__sigtramp2.S:1.5
--- src/lib/libc/arch/alpha/sys/__sigtramp2.S:1.4	Wed Oct 21 01:55:07 2020
+++ src/lib/libc/arch/alpha/sys/__sigtramp2.S	Wed Oct 21 01:58:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.4 2020/10/21 01:55:07 thorpej Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.5 2020/10/21 01:58:30 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -81,7 +81,7 @@
  * The unwind entry includes one instruction slot prior to the trampoline
  * because the unwinder will look up to (return PC - 1 insn) while unwinding.
  * Normally this would be the jump / branch, but since there isn't one in
- * this case, we place an explcit nop there instead.
+ * this case, we place an explicit nop there instead.
  */
 	nop
 



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

2020-10-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 21 01:55:07 UTC 2020

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

Log Message:
Add call frame unwind info to the Alpha signal trampoline.  Using
kamil@'s test program:

Before:
Backtrace 2 stack frames.
0x12a74  at ./test
0x3fffdca6550 <__sigtramp_siginfo_2> at /usr/lib/libc.so.12

After:
Backtrace 4 stack frames.
0x12a74  at ./test
0x3fffdca6554 <__sigtramp_siginfo_2> at /usr/lib/libc.so.12
0x12b10  at ./test
0x129b4 <___start+0x1a4> at ./test


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/alpha/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/alpha/sys/__sigtramp2.S
diff -u src/lib/libc/arch/alpha/sys/__sigtramp2.S:1.3 src/lib/libc/arch/alpha/sys/__sigtramp2.S:1.4
--- src/lib/libc/arch/alpha/sys/__sigtramp2.S:1.3	Wed Oct 21 01:24:05 2020
+++ src/lib/libc/arch/alpha/sys/__sigtramp2.S	Wed Oct 21 01:55:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.3 2020/10/21 01:24:05 thorpej Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.4 2020/10/21 01:55:07 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -39,10 +39,57 @@
  *		ucontext structure	[128] == sp + sizeof(siginfo_t)]
  *	sp->	siginfo structure	[0]
  */
+
+#define	CFI_OFFSET(r)	.cfi_offset r, SIZEOF_SIGINFO + UC_GREGS + r*8
+
+	.cfi_startproc simple
+	.cfi_signal_frame
+	.cfi_def_cfa _REG_SP, 0
+	CFI_OFFSET(_REG_V0)
+	CFI_OFFSET(_REG_T0)
+	CFI_OFFSET(_REG_T1)
+	CFI_OFFSET(_REG_T2)
+	CFI_OFFSET(_REG_T3)
+	CFI_OFFSET(_REG_T4)
+	CFI_OFFSET(_REG_T5)
+	CFI_OFFSET(_REG_T6)
+	CFI_OFFSET(_REG_T7)
+	CFI_OFFSET(_REG_S0)
+	CFI_OFFSET(_REG_S1)
+	CFI_OFFSET(_REG_S2)
+	CFI_OFFSET(_REG_S3)
+	CFI_OFFSET(_REG_S4)
+	CFI_OFFSET(_REG_S5)
+	CFI_OFFSET(_REG_S6)
+	CFI_OFFSET(_REG_A0)
+	CFI_OFFSET(_REG_A1)
+	CFI_OFFSET(_REG_A2)
+	CFI_OFFSET(_REG_A3)
+	CFI_OFFSET(_REG_A4)
+	CFI_OFFSET(_REG_A5)
+	CFI_OFFSET(_REG_T8)
+	CFI_OFFSET(_REG_T9)
+	CFI_OFFSET(_REG_T10)
+	CFI_OFFSET(_REG_T11)
+	CFI_OFFSET(_REG_RA)
+	CFI_OFFSET(_REG_T12)	/* a.k.a. _REG_PV */
+	CFI_OFFSET(_REG_AT)
+	CFI_OFFSET(_REG_GP)
+	CFI_OFFSET(_REG_SP)
+
+/*
+ * The unwind entry includes one instruction slot prior to the trampoline
+ * because the unwinder will look up to (return PC - 1 insn) while unwinding.
+ * Normally this would be the jump / branch, but since there isn't one in
+ * this case, we place an explcit nop there instead.
+ */
+	nop
+
 NESTED_NOPROFILE(__sigtramp_siginfo_2,0,0,ra,0,0)
 	ldgp	gp,0(ra)
 	lda	a0,(SIZEOF_SIGINFO)(sp)	/* get pointer to ucontext */
 	CALLSYS_NOERROR(setcontext)	/* and call setcontext() with it */
 	ldiq	a0,-1			/* if that failed, set an exit code */
 	CALLSYS_NOERROR(exit)		/* and call exit() */
+	.cfi_endproc
 END(__sigtramp_siginfo_2)



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

2020-10-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 21 01:24:05 UTC 2020

Modified Files:
src/lib/libc/arch/alpha: genassym.cf
src/lib/libc/arch/alpha/gen: __setjmp14.S swapcontext.S
src/lib/libc/arch/alpha/sys: __sigtramp2.S getcontext.S

Log Message:
- Consistently use _REG_* defines from assym.h to mean register numbers,
  not offsets (i.e. *8 to get the offset).
- Define and use SIZEOF_SIGINFO and UC_GREGS constants, rather than
  hard-code magic numbers.

NFC -- same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/alpha/genassym.cf
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/alpha/gen/__setjmp14.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/alpha/gen/swapcontext.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/alpha/sys/__sigtramp2.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/alpha/sys/getcontext.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/alpha/genassym.cf
diff -u src/lib/libc/arch/alpha/genassym.cf:1.2 src/lib/libc/arch/alpha/genassym.cf:1.3
--- src/lib/libc/arch/alpha/genassym.cf:1.2	Mon Apr 28 20:22:55 2008
+++ src/lib/libc/arch/alpha/genassym.cf	Wed Oct 21 01:24:04 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.2 2008/04/28 20:22:55 martin Exp $
+#	$NetBSD: genassym.cf,v 1.3 2020/10/21 01:24:04 thorpej Exp $
 
 #
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,41 +34,41 @@ include 
 include 
 include 
 
-define _REG_V0		8*_REG_V0	/* 0 */
-define _REG_T0		8*_REG_T0	/* 1 */
-define _REG_T1		8*_REG_T1	/* 2 */
-define _REG_T2		8*_REG_T2	/* 3 */
-define _REG_T3		8*_REG_T3	/* 4 */
-define _REG_T4		8*_REG_T4	/* 5 */
-define _REG_T5		8*_REG_T5	/* 6 */
-define _REG_T6		8*_REG_T6	/* 7 */
-define _REG_T7		8*_REG_T7	/* 8 */
-define _REG_S0		8*_REG_S0	/* 9 */
-define _REG_S1		8*_REG_S1	/* 10 */
-define _REG_S2		8*_REG_S2	/* 11 */
-define _REG_S3		8*_REG_S3	/* 12 */
-define _REG_S4		8*_REG_S4	/* 13 */
-define _REG_S5		8*_REG_S5	/* 14 */
-define _REG_S6		8*_REG_S6	/* 15 */
-define _REG_A0		8*_REG_A0	/* 16 */
-define _REG_A1		8*_REG_A1	/* 17 */
-define _REG_A2		8*_REG_A2	/* 18 */
-define _REG_A3		8*_REG_A3	/* 19 */
-define _REG_A4		8*_REG_A4	/* 20 */
-define _REG_A5		8*_REG_A5	/* 21 */
-define _REG_T8		8*_REG_T8	/* 22 */
-define _REG_T9		8*_REG_T9	/* 23 */
-define _REG_T10		8*_REG_T10	/* 24 */
-define _REG_T11		8*_REG_T11	/* 25 */
-define _REG_RA		8*_REG_RA	/* 26 */
-define _REG_T12		8*_REG_T12	/* 27 */
-define _REG_PV		8*_REG_PV	/* 27 */
-define _REG_AT		8*_REG_AT	/* 28 */
-define _REG_GP		8*_REG_GP	/* 29 */
-define _REG_SP		8*_REG_SP	/* 30 */
-define _REG_UNIQUE	8*_REG_UNIQUE	/* 31 */
-define _REG_PC		8*_REG_PC	/* 32 */
-define _REG_PS		8*_REG_PS	/* 33 */
+define _REG_V0		_REG_V0		/* 0 */
+define _REG_T0		_REG_T0		/* 1 */
+define _REG_T1		_REG_T1		/* 2 */
+define _REG_T2		_REG_T2		/* 3 */
+define _REG_T3		_REG_T3		/* 4 */
+define _REG_T4		_REG_T4		/* 5 */
+define _REG_T5		_REG_T5		/* 6 */
+define _REG_T6		_REG_T6		/* 7 */
+define _REG_T7		_REG_T7		/* 8 */
+define _REG_S0		_REG_S0		/* 9 */
+define _REG_S1		_REG_S1		/* 10 */
+define _REG_S2		_REG_S2		/* 11 */
+define _REG_S3		_REG_S3		/* 12 */
+define _REG_S4		_REG_S4		/* 13 */
+define _REG_S5		_REG_S5		/* 14 */
+define _REG_S6		_REG_S6		/* 15 */
+define _REG_A0		_REG_A0		/* 16 */
+define _REG_A1		_REG_A1		/* 17 */
+define _REG_A2		_REG_A2		/* 18 */
+define _REG_A3		_REG_A3		/* 19 */
+define _REG_A4		_REG_A4		/* 20 */
+define _REG_A5		_REG_A5		/* 21 */
+define _REG_T8		_REG_T8		/* 22 */
+define _REG_T9		_REG_T9		/* 23 */
+define _REG_T10		_REG_T10	/* 24 */
+define _REG_T11		_REG_T11	/* 25 */
+define _REG_RA		_REG_RA		/* 26 */
+define _REG_T12		_REG_T12	/* 27 */
+define _REG_PV		_REG_PV		/* 27 */
+define _REG_AT		_REG_AT		/* 28 */
+define _REG_GP		_REG_GP		/* 29 */
+define _REG_SP		_REG_SP		/* 30 */
+define _REG_UNIQUE	_REG_UNIQUE	/* 31 */
+define _REG_PC		_REG_PC		/* 32 */
+define _REG_PS		_REG_PS		/* 33 */
 
 define	SC_ONSTACK	offsetof(struct sigcontext, sc_onstack)
 define	SC_SP		offsetof(struct sigcontext, sc_sp)
@@ -82,3 +82,7 @@ define	SC_FP_CONTROL	offsetof(struct sig
 define	SC_MASK		offsetof(struct sigcontext, sc_mask)
 define	SC_RESERVED	offsetof(struct sigcontext, sc_reserved)
 define	SC_XXX		offsetof(struct sigcontext, sc_xxx)
+
+define	SIZEOF_SIGINFO	sizeof(siginfo_t)
+
+define	UC_GREGS	offsetof(ucontext_t, uc_mcontext.__gregs)

Index: src/lib/libc/arch/alpha/gen/__setjmp14.S
diff -u src/lib/libc/arch/alpha/gen/__setjmp14.S:1.7 src/lib/libc/arch/alpha/gen/__setjmp14.S:1.8
--- src/lib/libc/arch/alpha/gen/__setjmp14.S:1.7	Thu Jan 23 03:08:50 2014
+++ src/lib/libc/arch/alpha/gen/__setjmp14.S	Wed Oct 21 01:24:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __setjmp14.S,v 1.7 2014/01/23 03:08:50 christos Exp $ */
+/* $NetBSD: __setjmp14.S,v 1.8 2020/10/21 01:24:05 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -46,16 +

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

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 22:33:53 UTC 2020

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

Log Message:
Restore SP from mcontext

Improves unwinding of multiple frames without frame pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/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/aarch64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.3 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.4
--- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.3	Sat Oct 17 15:44:59 2020
+++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S	Mon Oct 19 22:33:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __sigtramp2.S,v 1.3 2020/10/17 15:44:59 skrll Exp $ */
+/* $NetBSD: __sigtramp2.S,v 1.4 2020/10/19 22:33:53 kamil Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
 	.cfi_offset x28, _UC_REGS_X28
 	.cfi_offset x29, _UC_REGS_X29
 	.cfi_offset lr, _UC_REGS_LR
-	/* The unwinder will use the CFA to restore X31 (SP). */
+	.cfi_offset sp, _UC_REGS_SP
 	nop
 ENTRY_NP(__sigtramp_siginfo_2)
 	mov	x0, x28/* set the arg */



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

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 11:31:02 UTC 2020

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

Log Message:
Restore ESP from mcontext

Improves unwinding of multiple frames without base pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/i386/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/i386/sys/__sigtramp2.S
diff -u src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6 src/lib/libc/arch/i386/sys/__sigtramp2.S:1.7
--- src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6	Mon Oct 12 23:56:08 2020
+++ src/lib/libc/arch/i386/sys/__sigtramp2.S	Mon Oct 19 11:31:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.6 2020/10/12 23:56:08 kamil Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.7 2020/10/19 11:31:01 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 	.cfi_offset ecx, UC_GREGS_ECX
 	.cfi_offset edx, UC_GREGS_EDX
 	.cfi_offset ebx, UC_GREGS_EBX
-	/* The unwinder will use the CFA to restore ESP. */
+	.cfi_offset esp, UC_GREGS_ESP
 	.cfi_offset ebp, UC_GREGS_EBP
 	.cfi_offset esi, UC_GREGS_ESI
 	.cfi_offset edi, UC_GREGS_EDI



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

2020-10-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 19 11:29:26 UTC 2020

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

Log Message:
Restore RSP from mcontext

Fixes unwinding of multiple frames without base pointer.

Patch by: Nikhil Benesch via PR lib/55719


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/x86_64/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/x86_64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.8 src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.9
--- src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.8	Mon Oct 12 17:55:54 2020
+++ src/lib/libc/arch/x86_64/sys/__sigtramp2.S	Mon Oct 19 11:29:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.8 2020/10/12 17:55:54 kamil Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.9 2020/10/19 11:29:26 kamil Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -58,7 +58,7 @@
 	.cfi_offset rsi, UC_GREGS_RSI
 	.cfi_offset rdi, UC_GREGS_RDI
 	.cfi_offset rbp, UC_GREGS_RBP
-	/* The unwinder will use the CFA to restore RSP. */
+	.cfi_offset rsp, UC_GREGS_RSP
 	.cfi_offset r8,  UC_GREGS_R8
 	.cfi_offset r9,  UC_GREGS_R9
 	.cfi_offset r10, UC_GREGS_R10



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

2020-10-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 17 15:44:59 UTC 2020

Modified Files:
src/lib/libc/arch/aarch64: genassym.cf
src/lib/libc/arch/aarch64/sys: __sigtramp2.S

Log Message:
Change x30 to lr for ease of reading

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/genassym.cf
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/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/aarch64/genassym.cf
diff -u src/lib/libc/arch/aarch64/genassym.cf:1.3 src/lib/libc/arch/aarch64/genassym.cf:1.4
--- src/lib/libc/arch/aarch64/genassym.cf:1.3	Tue Oct 13 01:59:55 2020
+++ src/lib/libc/arch/aarch64/genassym.cf	Sat Oct 17 15:44:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.3 2020/10/13 01:59:55 kamil Exp $
+# $NetBSD: genassym.cf,v 1.4 2020/10/17 15:44:59 skrll Exp $
 
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@ define _UC_REGS_X26	offsetof(ucontext_t,
 define _UC_REGS_X27	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X27])
 define _UC_REGS_X28	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X28])
 define _UC_REGS_X29	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X29])
-define _UC_REGS_X30	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X30])
+define _UC_REGS_LR	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_LR])
 define _UC_REGS_SP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
 define _UC_REGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
 

Index: src/lib/libc/arch/aarch64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.2 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.3
--- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.2	Tue Oct 13 01:59:55 2020
+++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S	Sat Oct 17 15:44:59 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __sigtramp2.S,v 1.2 2020/10/13 01:59:55 kamil Exp $ */
+/* $NetBSD: __sigtramp2.S,v 1.3 2020/10/17 15:44:59 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -81,7 +81,7 @@
 	.cfi_offset x27, _UC_REGS_X27
 	.cfi_offset x28, _UC_REGS_X28
 	.cfi_offset x29, _UC_REGS_X29
-	.cfi_offset x30, _UC_REGS_X30
+	.cfi_offset lr, _UC_REGS_LR
 	/* The unwinder will use the CFA to restore X31 (SP). */
 	nop
 ENTRY_NP(__sigtramp_siginfo_2)



CVS commit: src/lib/libc/arch

2020-10-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 15 05:50:15 UTC 2020

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/ia64/sys/__sigtramp2.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/sh3/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/ia64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/ia64/sys/__sigtramp2.S:1.1 src/lib/libc/arch/ia64/sys/__sigtramp2.S:1.2
--- src/lib/libc/arch/ia64/sys/__sigtramp2.S:1.1	Sat Sep 23 17:39:34 2006
+++ src/lib/libc/arch/ia64/sys/__sigtramp2.S	Thu Oct 15 05:50:14 2020
@@ -1,12 +1,12 @@
-/*	$NetBSD: __sigtramp2.S,v 1.1 2006/09/23 17:39:34 cherry Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.2 2020/10/15 05:50:14 skrll Exp $	*/
 
 #include "SYS.h"
 
 /* XXX:	 Fix this when we look at signal handling */
-	
+
 ENTRY(__sigtramp_siginfo_2, 2)
 	/* XXX:	 get pointer to ucontext */
-	/* setcontext() ie. CALLSYS_NOERROR(setcontext)  */ 
+	/* setcontext() ie. CALLSYS_NOERROR(setcontext)  */
 	/* get error code */
 	CALLSYS_NOERROR(exit) /* exit */
-END(__sigtramp_siginfo_2)
\ No newline at end of file
+END(__sigtramp_siginfo_2)

Index: src/lib/libc/arch/sh3/sys/__sigtramp2.S
diff -u src/lib/libc/arch/sh3/sys/__sigtramp2.S:1.3 src/lib/libc/arch/sh3/sys/__sigtramp2.S:1.4
--- src/lib/libc/arch/sh3/sys/__sigtramp2.S:1.3	Mon Apr 28 20:22:57 2008
+++ src/lib/libc/arch/sh3/sys/__sigtramp2.S	Thu Oct 15 05:50:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.3 2008/04/28 20:22:57 martin Exp $ */
+/*	$NetBSD: __sigtramp2.S,v 1.4 2020/10/15 05:50:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  * NB: This order is different from what other ports use (siginfo at
  * the top of the stack), because we want to avoid wasting two
  * instructions to skip to the ucontext.  Not that this order really
- * matters, but I think this inconsistency deserves an explanation.	
+ * matters, but I think this inconsistency deserves an explanation.
  */
 NENTRY(__sigtramp_siginfo_2)
 	mov	r15, r4			/* get pointer to ucontext */



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

2020-10-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Oct 15 05:43:38 UTC 2020

Modified Files:
src/lib/libc/arch/hppa: genassym.cf
src/lib/libc/arch/hppa/gen: swapcontext.S
src/lib/libc/arch/hppa/sys: getcontext.S

Log Message:
Remove '_OFFSETOF' prefix for genassm(1) generate CPP identifers for
consistency with other arches.

NFCI and libc.so is the same before and after.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/hppa/genassym.cf
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/hppa/gen/swapcontext.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/sys/getcontext.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/hppa/genassym.cf
diff -u src/lib/libc/arch/hppa/genassym.cf:1.1 src/lib/libc/arch/hppa/genassym.cf:1.2
--- src/lib/libc/arch/hppa/genassym.cf:1.1	Wed Feb 19 13:01:51 2014
+++ src/lib/libc/arch/hppa/genassym.cf	Thu Oct 15 05:43:38 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.1 2014/02/19 13:01:51 skrll Exp $
+#	$NetBSD: genassym.cf,v 1.2 2020/10/15 05:43:38 skrll Exp $
 
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,4 +36,4 @@ define _REG_PCOQH	_REG_PCOQH
 define _REG_PCOQT	_REG_PCOQT
 define _REG_RET0	_REG_RET0
 
-define _OFFSETOF_UC_GREGS	offsetof(ucontext_t, uc_mcontext.__gregs[0])
+define _UC_GREGS	offsetof(ucontext_t, uc_mcontext.__gregs[0])

Index: src/lib/libc/arch/hppa/gen/swapcontext.S
diff -u src/lib/libc/arch/hppa/gen/swapcontext.S:1.7 src/lib/libc/arch/hppa/gen/swapcontext.S:1.8
--- src/lib/libc/arch/hppa/gen/swapcontext.S:1.7	Tue May  5 06:20:55 2020
+++ src/lib/libc/arch/hppa/gen/swapcontext.S	Thu Oct 15 05:43:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.7 2020/05/05 06:20:55 skrll Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.8 2020/10/15 05:43:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include 
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: swapcontext.S,v 1.7 2020/05/05 06:20:55 skrll Exp $")
+	RCSID("$NetBSD: swapcontext.S,v 1.8 2020/10/15 05:43:38 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 LEAF_ENTRY(swapcontext)
@@ -49,10 +49,10 @@ LEAF_ENTRY(swapcontext)
 
 	ldw	HPPA_FRAME_CRP(%sp), %rp
 	ldo	4(%rp), %r1
-	stw	%r1, (_OFFSETOF_UC_GREGS + _REG_PCOQT * SZREG)(%arg1)
-	stw	%rp, (_OFFSETOF_UC_GREGS + _REG_PCOQH * SZREG)(%arg1)
+	stw	%r1, (_UC_GREGS + _REG_PCOQT * SZREG)(%arg1)
+	stw	%rp, (_UC_GREGS + _REG_PCOQH * SZREG)(%arg1)
 	bl	setcontext, %rp
-	 stw	%r0, (_OFFSETOF_UC_GREGS + _REG_RET0 * SZREG)(%arg1)
+	 stw	%r0, (_UC_GREGS + _REG_RET0 * SZREG)(%arg1)
 
 	ldw	HPPA_FRAME_CRP(%sp), %rp
 	bv,n	%r0(%rp)

Index: src/lib/libc/arch/hppa/sys/getcontext.S
diff -u src/lib/libc/arch/hppa/sys/getcontext.S:1.6 src/lib/libc/arch/hppa/sys/getcontext.S:1.7
--- src/lib/libc/arch/hppa/sys/getcontext.S:1.6	Tue May  5 06:20:55 2020
+++ src/lib/libc/arch/hppa/sys/getcontext.S	Thu Oct 15 05:43:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.6 2020/05/05 06:20:55 skrll Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.7 2020/10/15 05:43:38 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -38,9 +38,9 @@ WEAK_ALIAS(getcontext, _getcontext)
 
 ENTRY(_getcontext, 0)
 	SYSCALL(getcontext)
-	stw	%rp, (_OFFSETOF_UC_GREGS + _REG_PCOQH * SZREG)(%arg0)
+	stw	%rp, (_UC_GREGS + _REG_PCOQH * SZREG)(%arg0)
 	ldo	4(%rp), %r1
-	stw	%r1, (_OFFSETOF_UC_GREGS + _REG_PCOQT * SZREG)(%arg0)
+	stw	%r1, (_UC_GREGS + _REG_PCOQT * SZREG)(%arg0)
 	bv	%r0(%rp)
-	 stw	%r0, (_OFFSETOF_UC_GREGS + _REG_RET0 * SZREG)(%arg0)
+	 stw	%r0, (_UC_GREGS + _REG_RET0 * SZREG)(%arg0)
 EXIT(_getcontext)



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

2020-10-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Oct 13 01:59:55 UTC 2020

Modified Files:
src/lib/libc/arch/aarch64: genassym.cf
src/lib/libc/arch/aarch64/sys: __sigtramp2.S

Log Message:
Decorate the aarch64 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/genassym.cf
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/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/aarch64/genassym.cf
diff -u src/lib/libc/arch/aarch64/genassym.cf:1.2 src/lib/libc/arch/aarch64/genassym.cf:1.3
--- src/lib/libc/arch/aarch64/genassym.cf:1.2	Sun May 10 14:05:59 2020
+++ src/lib/libc/arch/aarch64/genassym.cf	Tue Oct 13 01:59:55 2020
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.2 2020/05/10 14:05:59 skrll Exp $
+# $NetBSD: genassym.cf,v 1.3 2020/10/13 01:59:55 kamil Exp $
 
 #-
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -34,6 +34,36 @@ include 
 include 
 
 define _UC_REGS_X0	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X0])
+define _UC_REGS_X1	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X1])
+define _UC_REGS_X2	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X2])
+define _UC_REGS_X3	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X3])
+define _UC_REGS_X4	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X4])
+define _UC_REGS_X5	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X5])
+define _UC_REGS_X6	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X6])
+define _UC_REGS_X7	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X7])
+define _UC_REGS_X8	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X8])
+define _UC_REGS_X9	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X9])
+define _UC_REGS_X10	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X10])
+define _UC_REGS_X11	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X11])
+define _UC_REGS_X12	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X12])
+define _UC_REGS_X13	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X13])
+define _UC_REGS_X14	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X14])
+define _UC_REGS_X15	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X15])
+define _UC_REGS_X16	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X16])
+define _UC_REGS_X17	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X17])
+define _UC_REGS_X18	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X18])
+define _UC_REGS_X19	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X19])
+define _UC_REGS_X20	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X20])
+define _UC_REGS_X21	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X21])
+define _UC_REGS_X22	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X22])
+define _UC_REGS_X23	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X23])
+define _UC_REGS_X24	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X24])
+define _UC_REGS_X25	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X25])
+define _UC_REGS_X26	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X26])
+define _UC_REGS_X27	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X27])
+define _UC_REGS_X28	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X28])
+define _UC_REGS_X29	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X29])
+define _UC_REGS_X30	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_X30])
 define _UC_REGS_SP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
 define _UC_REGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
 

Index: src/lib/libc/arch/aarch64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.1 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.2
--- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S	Tue Oct 13 01:59:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: __sigtramp2.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: __sigtramp2.S,v 1.2 2020/10/13 01:59:55 kamil Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,6 +30,7 @@
  */
 
 #include "SYS.h"
+#include "assym.h"
 
 /*
  * The ARM signal trampoline is invoked only to return from
@@ -40,11 +41,54 @@
  *		ucontext structure
  *	sp->	siginfo structure
  * and x28 points to the ucontext
+ *
+ * The unwind entry includes the one byte prior to the trampoline
+ * because the unwinder will look up (return PC - 1) while unwinding.
+ * Normally (return PC - 1) computes an address inside the call
+ * instruction that created the child frame, but here there is no call
+ * instruction so we have to manually add padding.
  */
+	.cfi_startproc simple
+	.cfi_signal_frame
+	.cfi_def_cfa x28, 0
+	.cfi_offset x0, _UC_REGS_X0
+	.cfi_offset x1, _UC_REGS_X1
+	.cfi_offset x2, _UC_REGS_X2
+	.cfi_offset x3, _UC_REGS_X3
+	.cfi_offset x4, _UC_REGS_X4
+	.cfi_offset x5, _UC_REGS_X5
+	.cfi_offset x6, _UC_REGS_X6
+	.cfi_offset x7, _UC_REGS_X7
+	.cfi_offse

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

2020-10-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 12 23:58:14 UTC 2020

Modified Files:
src/lib/libc/arch/i386: genassym.cf

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/i386/genassym.cf

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/i386/genassym.cf
diff -u src/lib/libc/arch/i386/genassym.cf:1.1 src/lib/libc/arch/i386/genassym.cf:1.2
--- src/lib/libc/arch/i386/genassym.cf:1.1	Mon Oct 12 23:56:08 2020
+++ src/lib/libc/arch/i386/genassym.cf	Mon Oct 12 23:58:14 2020
@@ -1,10 +1,10 @@
-#	$NetBSD: genassym.cf,v 1.1 2020/10/12 23:56:08 kamil Exp $
+#	$NetBSD: genassym.cf,v 1.2 2020/10/12 23:58:14 kamil Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
-# by Kamil Rytarowski or Moritz Systems Technology Company Sp. z o.o.
+# by Kamil Rytarowski for Moritz Systems Technology Company Sp. z o.o.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions



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

2020-10-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 12 23:56:08 UTC 2020

Modified Files:
src/lib/libc/arch/i386: Makefile.inc
src/lib/libc/arch/i386/sys: __sigtramp2.S
Added Files:
src/lib/libc/arch/i386: genassym.cf

Log Message:
Decorate the i386 signal trampoline with CFI attributes easing unwinding

Now, the unwinders (in backtrace(3) and similar) can unwind properly
the stack from a signal handler.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/arch/i386/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/i386/genassym.cf
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/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/i386/Makefile.inc
diff -u src/lib/libc/arch/i386/Makefile.inc:1.21 src/lib/libc/arch/i386/Makefile.inc:1.22
--- src/lib/libc/arch/i386/Makefile.inc:1.21	Wed Jul 15 14:27:49 2015
+++ src/lib/libc/arch/i386/Makefile.inc	Mon Oct 12 23:56:08 2020
@@ -1,5 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.21 2015/07/15 14:27:49 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.22 2020/10/12 23:56:08 kamil Exp $
 
 .if ${RUMPRUN} != "yes"
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
 .endif
+
+CPPFLAGS+=	-I.

Index: src/lib/libc/arch/i386/sys/__sigtramp2.S
diff -u src/lib/libc/arch/i386/sys/__sigtramp2.S:1.5 src/lib/libc/arch/i386/sys/__sigtramp2.S:1.6
--- src/lib/libc/arch/i386/sys/__sigtramp2.S:1.5	Fri May 23 02:34:19 2014
+++ src/lib/libc/arch/i386/sys/__sigtramp2.S	Mon Oct 12 23:56:08 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.5 2014/05/23 02:34:19 uebayasi Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.6 2020/10/12 23:56:08 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,6 +30,7 @@
  */
 
 #include "SYS.h"
+#include "assym.h"
 
 /*
  * The i386 signal trampoline is invoked only to return from
@@ -42,7 +43,26 @@
  *		pointer to ucontext structure		[8]
  *		pointer to siginfo structure		[4]
  *	sp->	signal number[0]
+ *
+ * The unwind entry includes the one byte prior to the trampoline
+ * because the unwinder will look up (return PC - 1) while unwinding.
+ * Normally (return PC - 1) computes an address inside the call
+ * instruction that created the child frame, but here there is no call
+ * instruction so we have to manually add padding.
  */
+	.cfi_startproc simple
+	.cfi_signal_frame
+	.cfi_def_cfa esp, 140
+	.cfi_offset eax, UC_GREGS_EAX
+	.cfi_offset ecx, UC_GREGS_ECX
+	.cfi_offset edx, UC_GREGS_EDX
+	.cfi_offset ebx, UC_GREGS_EBX
+	/* The unwinder will use the CFA to restore ESP. */
+	.cfi_offset ebp, UC_GREGS_EBP
+	.cfi_offset esi, UC_GREGS_ESI
+	.cfi_offset edi, UC_GREGS_EDI
+	.cfi_offset eip, UC_GREGS_EIP
+	nop
 NENTRY(__sigtramp_siginfo_2)
 	leal	12+128(%esp),%eax	/* get address of ucontext */
 	movl	%eax,4(%esp)	/* put it in the argument slot */
@@ -50,4 +70,5 @@ NENTRY(__sigtramp_siginfo_2)
 	SYSTRAP(setcontext)	/* do setcontext */
 	movl	$-1,4(%esp)	/* if we return here, something is wrong */
 	SYSTRAP(exit)		/* exit */
+	.cfi_endproc
 END(__sigtramp_siginfo_2)

Added files:

Index: src/lib/libc/arch/i386/genassym.cf
diff -u /dev/null src/lib/libc/arch/i386/genassym.cf:1.1
--- /dev/null	Mon Oct 12 23:56:08 2020
+++ src/lib/libc/arch/i386/genassym.cf	Mon Oct 12 23:56:08 2020
@@ -0,0 +1,41 @@
+#	$NetBSD: genassym.cf,v 1.1 2020/10/12 23:56:08 kamil Exp $
+#
+# Copyright (c) 2020 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Kamil Rytarowski or Moritz Systems Technology Company Sp. z o.o.
+#
+# 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

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

2020-10-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 12 21:33:46 UTC 2020

Modified Files:
src/lib/libc/arch/x86_64: genassym.cf

Log Message:
Add CVS Id


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/x86_64/genassym.cf

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/x86_64/genassym.cf
diff -u src/lib/libc/arch/x86_64/genassym.cf:1.1 src/lib/libc/arch/x86_64/genassym.cf:1.2
--- src/lib/libc/arch/x86_64/genassym.cf:1.1	Mon Oct 12 17:55:53 2020
+++ src/lib/libc/arch/x86_64/genassym.cf	Mon Oct 12 21:33:46 2020
@@ -1,3 +1,4 @@
+#	$NetBSD: genassym.cf,v 1.2 2020/10/12 21:33:46 kamil Exp $
 #
 # Copyright (c) 2020 The NetBSD Foundation, Inc.
 # All rights reserved.



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

2020-10-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Oct 12 17:55:54 UTC 2020

Modified Files:
src/lib/libc/arch/x86_64: Makefile.inc
src/lib/libc/arch/x86_64/sys: __sigtramp2.S
Added Files:
src/lib/libc/arch/x86_64: genassym.cf

Log Message:
Decorate the x86_64 signal trampoline with CFI attributes easing unwinding

Combine the approach provided by Nikhil Benesch and Andrew Cagney.

Now, the unwinders (in gccgo, backtrace(3), etc) can unwind properly
the stack from a signal handler.

Fixes lib/55719 by Nikhil Benesch


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/x86_64/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/x86_64/genassym.cf
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/x86_64/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/x86_64/Makefile.inc
diff -u src/lib/libc/arch/x86_64/Makefile.inc:1.6 src/lib/libc/arch/x86_64/Makefile.inc:1.7
--- src/lib/libc/arch/x86_64/Makefile.inc:1.6	Wed Jul 15 14:27:49 2015
+++ src/lib/libc/arch/x86_64/Makefile.inc	Mon Oct 12 17:55:53 2020
@@ -1,5 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.6 2015/07/15 14:27:49 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2020/10/12 17:55:53 kamil Exp $
 
 .if ${RUMPRUN} != "yes"
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
 .endif
+
+CPPFLAGS+=	-I.

Index: src/lib/libc/arch/x86_64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.7 src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.8
--- src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.7	Mon Dec  2 01:38:54 2019
+++ src/lib/libc/arch/x86_64/sys/__sigtramp2.S	Mon Oct 12 17:55:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.7 2019/12/02 01:38:54 christos Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.8 2020/10/12 17:55:54 kamil Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,14 +36,40 @@
  */
 
 #include "SYS.h"
+#include "assym.h"
 
 /*
  * The x86-64 signal trampoline is invoked only to return from
  * the signal; the kernel calls the signal handler directly.
+ *
+ * The unwind entry includes the one byte prior to the trampoline
+ * because the unwinder will look up (return PC - 1) while unwinding.
+ * Normally (return PC - 1) computes an address inside the call
+ * instruction that created the child frame, but here there is no call
+ * instruction so we have to manually add padding.
  */
+	.cfi_startproc simple
+	.cfi_signal_frame
+	.cfi_def_cfa r15, 0
+	.cfi_offset rax, UC_GREGS_RAX
+	.cfi_offset rdx, UC_GREGS_RDX
+	.cfi_offset rcx, UC_GREGS_RCX
+	.cfi_offset rbx, UC_GREGS_RBX
+	.cfi_offset rsi, UC_GREGS_RSI
+	.cfi_offset rdi, UC_GREGS_RDI
+	.cfi_offset rbp, UC_GREGS_RBP
+	/* The unwinder will use the CFA to restore RSP. */
+	.cfi_offset r8,  UC_GREGS_R8
+	.cfi_offset r9,  UC_GREGS_R9
+	.cfi_offset r10, UC_GREGS_R10
+	.cfi_offset r11, UC_GREGS_R11
+	.cfi_offset r12, UC_GREGS_R12
+	.cfi_offset r13, UC_GREGS_R13
+	.cfi_offset r14, UC_GREGS_R14
+	.cfi_offset r15, UC_GREGS_R15
+	.cfi_offset rip, UC_GREGS_RIP
+	nop
 NENTRY(__sigtramp_siginfo_2)
-	.cfi_startproc
-	.cfi_def_cfa rsp, 8
 	movq	%r15,%rdi
 	movq	$SYS_setcontext, %rax
 	syscall

Added files:

Index: src/lib/libc/arch/x86_64/genassym.cf
diff -u /dev/null src/lib/libc/arch/x86_64/genassym.cf:1.1
--- /dev/null	Mon Oct 12 17:55:54 2020
+++ src/lib/libc/arch/x86_64/genassym.cf	Mon Oct 12 17:55:53 2020
@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2020 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+include 
+
+define UC_GREGS_RAX offsetof(ucontext_t, uc_mcontext.__gregs[_REG_RAX])
+define UC_GREGS_RDX offsetof(ucontext_t, uc_mcontex

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

2020-06-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 06:49:04 UTC 2020

Modified Files:
src/lib/libc/arch/powerpc/gen: _lwp.c

Log Message:
Turn on _UC_TLSBASE for sure in the same manner as other ports.
No functional changes since that flag is turned on via getcontext(2).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/powerpc/gen/_lwp.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/powerpc/gen/_lwp.c
diff -u src/lib/libc/arch/powerpc/gen/_lwp.c:1.7 src/lib/libc/arch/powerpc/gen/_lwp.c:1.8
--- src/lib/libc/arch/powerpc/gen/_lwp.c:1.7	Thu Mar 22 05:36:50 2012
+++ src/lib/libc/arch/powerpc/gen/_lwp.c	Mon Jun 22 06:49:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.7 2012/03/22 05:36:50 matt Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.8 2020/06/22 06:49:04 rin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.7 2012/03/22 05:36:50 matt Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.8 2020/06/22 06:49:04 rin Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -67,6 +67,8 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u->uc_mcontext.__gregs[1] = sp;/* stack */
 	u->uc_mcontext.__gregs[33] = (uintptr_t) _lwp_exit;	/* LR */
 	u->uc_mcontext.__gregs[34] = (uintptr_t) start;		/* PC */
+
 	u->uc_mcontext.__gregs[_REG_R2] =
 	(uintptr_t)tcb + TLS_TP_OFFSET + sizeof(struct tls_tcb);
+	u->uc_flags |= _UC_TLSBASE;
 }



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

2020-05-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May 10 14:34:31 UTC 2020

Modified Files:
src/lib/libc/arch/hppa/sys: brk.S sbrk.S

Log Message:
Rename curbrk to __curbrk, and make it and __minbrk hidden


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/hppa/sys/brk.S
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/hppa/sys/sbrk.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/hppa/sys/brk.S
diff -u src/lib/libc/arch/hppa/sys/brk.S:1.8 src/lib/libc/arch/hppa/sys/brk.S:1.9
--- src/lib/libc/arch/hppa/sys/brk.S:1.8	Tue May  5 06:20:55 2020
+++ src/lib/libc/arch/hppa/sys/brk.S	Sun May 10 14:34:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: brk.S,v 1.8 2020/05/05 06:20:55 skrll Exp $	*/
+/*	$NetBSD: brk.S,v 1.9 2020/05/10 14:34:31 skrll Exp $	*/
 
 /*	$OpenBSD: brk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $	*/
 
@@ -31,10 +31,11 @@
 #include "SYS.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: brk.S,v 1.8 2020/05/05 06:20:55 skrll Exp $")
+	RCSID("$NetBSD: brk.S,v 1.9 2020/05/10 14:34:31 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
-	.import	curbrk, data
+	.import	__curbrk, data
+	.hidden __curbrk
 	.global	_end
 
 #ifdef WEAK_ALIAS
@@ -43,6 +44,7 @@
 
 	.data
 	.export	__minbrk, data
+	.hidden __minbrk
 __minbrk:
 	.long	_end
 
@@ -63,14 +65,14 @@ ENTRY(_brk,0)
 
 	ldw	HPPA_FRAME_ARG(0)(%sp), %arg0
 #ifdef __PIC__
-	addil	LT%curbrk, %r19
-	ldw	RT%curbrk(%r1), %r1
+	addil	LT%__curbrk, %r19
+	ldw	RT%__curbrk(%r1), %r1
 	bv	%r0(%rp)
 	 stw	%arg0, 0(%r1)
 #else  /* !__PIC__ */
-	ldil	L%curbrk, %t1
+	ldil	L%__curbrk, %t1
 	bv	%r0(%rp)
-	 stw	%arg0, R%curbrk(%t1)
+	 stw	%arg0, R%__curbrk(%t1)
 #endif /* !__PIC__ */
 EXIT(brk)
 

Index: src/lib/libc/arch/hppa/sys/sbrk.S
diff -u src/lib/libc/arch/hppa/sys/sbrk.S:1.7 src/lib/libc/arch/hppa/sys/sbrk.S:1.8
--- src/lib/libc/arch/hppa/sys/sbrk.S:1.7	Tue May  5 06:20:55 2020
+++ src/lib/libc/arch/hppa/sys/sbrk.S	Sun May 10 14:34:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbrk.S,v 1.7 2020/05/05 06:20:55 skrll Exp $	*/
+/*	$NetBSD: sbrk.S,v 1.8 2020/05/10 14:34:31 skrll Exp $	*/
 
 /*	$OpenBSD: sbrk.S,v 1.7 2001/06/04 23:14:04 mickey Exp $	*/
 
@@ -31,7 +31,7 @@
 #include "SYS.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: sbrk.S,v 1.7 2020/05/05 06:20:55 skrll Exp $")
+	RCSID("$NetBSD: sbrk.S,v 1.8 2020/05/10 14:34:31 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 	.global	_end
@@ -41,18 +41,19 @@
 #endif
 
 	.data
-	.export	curbrk, data
-curbrk:
+	.export	__curbrk, data
+	.hidden __curbrk
+__curbrk:
 	.long	_end
 
 ENTRY(_sbrk,0)
 #ifdef __PIC__
-	addil	LT%curbrk, %r19
-	ldw	RT%curbrk(%r1), %r1
+	addil	LT%__curbrk, %r19
+	ldw	RT%__curbrk(%r1), %r1
 	ldw	0(%r1), %t2
 #else  /* !__PIC__ */
-	ldil	L%curbrk, %t1
-	ldw	R%curbrk(%t1), %t2
+	ldil	L%__curbrk, %t1
+	ldw	R%__curbrk(%t1), %t2
 #endif /* !__PIC__ */
 	add	%arg0, %t2, %arg0
 	stw	%arg0, HPPA_FRAME_ARG(0)(%sp)
@@ -60,11 +61,11 @@ ENTRY(_sbrk,0)
 	SYSCALL(break)
 
 #ifdef __PIC__
-	addil	LT%curbrk, %r19
-	ldw	RT%curbrk(%r1), %r1
+	addil	LT%__curbrk, %r19
+	ldw	RT%__curbrk(%r1), %r1
 #else  /* !__PIC__ */
-	ldil	L%curbrk, %t1
-	ldo	R%curbrk(%t1), %r1
+	ldil	L%__curbrk, %t1
+	ldo	R%__curbrk(%t1), %r1
 #endif /* !__PIC__ */
 	ldw	0(%r1), %ret0
 	ldw	HPPA_FRAME_ARG(0)(%sp), %arg0



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

2020-05-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May  9 08:25:34 UTC 2020

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

Log Message:
No need to .import __cerror as SYS.h does it


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/hppa/sys/__vfork14.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/sys/ptrace.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/hppa/sys/__vfork14.S
diff -u src/lib/libc/arch/hppa/sys/__vfork14.S:1.9 src/lib/libc/arch/hppa/sys/__vfork14.S:1.10
--- src/lib/libc/arch/hppa/sys/__vfork14.S:1.9	Tue May  5 20:43:47 2020
+++ src/lib/libc/arch/hppa/sys/__vfork14.S	Sat May  9 08:25:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __vfork14.S,v 1.9 2020/05/05 20:43:47 skrll Exp $	*/
+/*	$NetBSD: __vfork14.S,v 1.10 2020/05/09 08:25:33 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -52,8 +52,6 @@ ENTRY(__vfork14, 0)
 	 * syscall entry code in locore.S has been modified
 	 * to do just this for the t4 register.
 	 */
-	.import	__cerror, code
-
 	copy	%rp, %t4
 	ldil	L%SYSCALLGATE, %r1
 	ble	4(%sr2, %r1)

Index: src/lib/libc/arch/hppa/sys/ptrace.S
diff -u src/lib/libc/arch/hppa/sys/ptrace.S:1.6 src/lib/libc/arch/hppa/sys/ptrace.S:1.7
--- src/lib/libc/arch/hppa/sys/ptrace.S:1.6	Mon Apr 28 20:22:56 2008
+++ src/lib/libc/arch/hppa/sys/ptrace.S	Sat May  9 08:25:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.S,v 1.6 2008/04/28 20:22:56 martin Exp $	*/
+/*	$NetBSD: ptrace.S,v 1.7 2020/05/09 08:25:33 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,8 +32,6 @@
 #include 
 #include "SYS.h"
 
-	.import __cerror, code
-
 /*
  * int ptrace(int request, pid_t pid, void * addr, int data);
  */



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

2020-05-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May  5 20:39:18 UTC 2020

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

Log Message:
Add a space before any non-nullified instruction.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/hppa/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/hppa/SYS.h
diff -u src/lib/libc/arch/hppa/SYS.h:1.10 src/lib/libc/arch/hppa/SYS.h:1.11
--- src/lib/libc/arch/hppa/SYS.h:1.10	Tue May  5 06:06:16 2020
+++ src/lib/libc/arch/hppa/SYS.h	Tue May  5 20:39:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: SYS.h,v 1.10 2020/05/05 06:06:16 skrll Exp $	*/
+/*	$NetBSD: SYS.h,v 1.11 2020/05/05 20:39:18 skrll Exp $	*/
 
 /*	$OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $	*/
 
@@ -42,13 +42,13 @@
 	ldi	__CONCAT(SYS_,x), %t1		!\
 	.import __cerror, code			!\
 	comb,<>	%r0, %t1, __cerror		!\
-	ldw	HPPA_FRAME_ERP(%sr0,%sp), %rp
+	 ldw	HPPA_FRAME_ERP(%sr0,%sp), %rp
 
 #define	PSEUDO(x,y)!\
 SYSENTRY(x)	!\
 	SYSCALL(y)!\
 	bv	%r0(%rp)			!\
-	nop	!\
+	 nop	!\
 SYSEXIT(x)
 
 #define	PSEUDO_NOERROR(x,y)			!\
@@ -56,10 +56,10 @@ SYSENTRY(x)	!\
 	stw	%rp, HPPA_FRAME_ERP(%sr0,%sp)	!\
 	ldil	L%SYSCALLGATE, %r1		!\
 	ble	4(%sr2, %r1)			!\
-	ldi	__CONCAT(SYS_,y), %t1		!\
+	 ldi	__CONCAT(SYS_,y), %t1		!\
 	ldw	HPPA_FRAME_ERP(%sr0,%sp), %rp	!\
 	bv	%r0(%rp)			!\
-	nop	!\
+	 nop	!\
 SYSEXIT(x)
 
 #define RSYSCALL(x)		PSEUDO(x,x)



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

2020-05-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May  5 06:06:17 UTC 2020

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

Log Message:
Remove unnecesary #define/#undef _LOCORE


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/hppa/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/hppa/SYS.h
diff -u src/lib/libc/arch/hppa/SYS.h:1.9 src/lib/libc/arch/hppa/SYS.h:1.10
--- src/lib/libc/arch/hppa/SYS.h:1.9	Thu Mar  6 19:02:58 2014
+++ src/lib/libc/arch/hppa/SYS.h	Tue May  5 06:06:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: SYS.h,v 1.9 2014/03/06 19:02:58 skrll Exp $	*/
+/*	$NetBSD: SYS.h,v 1.10 2020/05/05 06:06:16 skrll Exp $	*/
 
 /*	$OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $	*/
 
@@ -30,8 +30,6 @@
 #include 
 #include 
 #include 
-#undef _LOCORE
-#define _LOCORE
 #include 
 
 #define	SYSENTRY(x)	LEAF_ENTRY(x)



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

2020-05-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May  4 06:42:11 UTC 2020

Modified Files:
src/lib/libc/arch/hppa/gen: __setjmp14.S _setjmp.S

Log Message:
Remove unnecesary #define/#undef _LOCORE


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/hppa/gen/__setjmp14.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/hppa/gen/_setjmp.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/hppa/gen/__setjmp14.S
diff -u src/lib/libc/arch/hppa/gen/__setjmp14.S:1.7 src/lib/libc/arch/hppa/gen/__setjmp14.S:1.8
--- src/lib/libc/arch/hppa/gen/__setjmp14.S:1.7	Sun May  3 15:29:22 2020
+++ src/lib/libc/arch/hppa/gen/__setjmp14.S	Mon May  4 06:42:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __setjmp14.S,v 1.7 2020/05/03 15:29:22 skrll Exp $	*/
+/*	$NetBSD: __setjmp14.S,v 1.8 2020/05/04 06:42:11 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,14 +30,11 @@
  */
 
 #include 
-/* XXX fredette - this is awful */
-#define _LOCORE
 #include 
-#undef _LOCORE
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __setjmp14.S,v 1.7 2020/05/03 15:29:22 skrll Exp $")
+	RCSID("$NetBSD: __setjmp14.S,v 1.8 2020/05/04 06:42:11 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*

Index: src/lib/libc/arch/hppa/gen/_setjmp.S
diff -u src/lib/libc/arch/hppa/gen/_setjmp.S:1.4 src/lib/libc/arch/hppa/gen/_setjmp.S:1.5
--- src/lib/libc/arch/hppa/gen/_setjmp.S:1.4	Mon Apr 28 20:22:56 2008
+++ src/lib/libc/arch/hppa/gen/_setjmp.S	Mon May  4 06:42:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: _setjmp.S,v 1.4 2008/04/28 20:22:56 martin Exp $	*/
+/*	$NetBSD: _setjmp.S,v 1.5 2020/05/04 06:42:11 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,13 +30,10 @@
  */
 
 #include 
-/* XXX fredette - this is awful */
-#define _LOCORE
 #include 
-#undef _LOCORE
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _setjmp.S,v 1.4 2008/04/28 20:22:56 martin Exp $")
+	RCSID("$NetBSD: _setjmp.S,v 1.5 2020/05/04 06:42:11 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*



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

2020-05-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May  3 15:29:22 UTC 2020

Modified Files:
src/lib/libc/arch/hppa/gen: __setjmp14.S
src/lib/libc/arch/hppa/string: bzero.S ffs.S strlcpy.S
src/lib/libc/arch/hppa/sys: brk.S

Log Message:
Even more trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/gen/__setjmp14.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/hppa/string/bzero.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/hppa/string/ffs.S \
src/lib/libc/arch/hppa/string/strlcpy.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/hppa/sys/brk.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/hppa/gen/__setjmp14.S
diff -u src/lib/libc/arch/hppa/gen/__setjmp14.S:1.6 src/lib/libc/arch/hppa/gen/__setjmp14.S:1.7
--- src/lib/libc/arch/hppa/gen/__setjmp14.S:1.6	Sat Jul 16 09:51:13 2016
+++ src/lib/libc/arch/hppa/gen/__setjmp14.S	Sun May  3 15:29:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: __setjmp14.S,v 1.6 2016/07/16 09:51:13 skrll Exp $	*/
+/*	$NetBSD: __setjmp14.S,v 1.7 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __setjmp14.S,v 1.6 2016/07/16 09:51:13 skrll Exp $")
+	RCSID("$NetBSD: __setjmp14.S,v 1.7 2020/05/03 15:29:22 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -112,9 +112,9 @@ ENTRY(__setjmp14,0)
 	ldi	1, %r20			; SS_ONSTACK
 	and	%r1, %r20, %r1
 	stw	%r1, 0(%arg0)		; sc.sc_onstack
-	
+
 	/* Get the signal mask. */
-	ldo	40(%arg0), %arg2	; oset = &sc.sc_mask	
+	ldo	40(%arg0), %arg2	; oset = &sc.sc_mask
 	copy	%r0, %arg1		; set = NULL
 	bl	__sigprocmask14, %rp
 	copy	%r0, %arg0		; action = 0 

Index: src/lib/libc/arch/hppa/string/bzero.S
diff -u src/lib/libc/arch/hppa/string/bzero.S:1.2 src/lib/libc/arch/hppa/string/bzero.S:1.3
--- src/lib/libc/arch/hppa/string/bzero.S:1.2	Mon Oct  6 05:30:21 2003
+++ src/lib/libc/arch/hppa/string/bzero.S	Sun May  3 15:29:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bzero.S,v 1.2 2003/10/06 05:30:21 matt Exp $	*/
+/*	$NetBSD: bzero.S,v 1.3 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*	$OpenBSD: bzero.S,v 1.3 2001/06/04 23:14:02 mickey Exp $	*/
 
@@ -40,7 +40,7 @@
 #endif
 
 /*
- * void 
+ * void
  * bzero(dst, count)
  *	void *dst;
  *	size_t count;
@@ -55,7 +55,7 @@ LEAF_ENTRY(bzero)
 	comib,>>,n 4,%arg1,$bzero_bytes
 
 	/*
-	 * Since we are only clearing memory the alignment restrictions 
+	 * Since we are only clearing memory the alignment restrictions
 	 * are simplified. Figure out how many "extra" bytes we need to
 	 * store with stbys.
 	 */
@@ -64,7 +64,7 @@ LEAF_ENTRY(bzero)
 add %arg1,%t1,%arg1
 
 	/*
-	 * We will zero the destination in blocks of 16 bytes as long as we 
+	 * We will zero the destination in blocks of 16 bytes as long as we
 	 * can and then we'll go to the 4 byte moves.
 	 */
 
@@ -80,8 +80,8 @@ $bzero_loop_16:
 	addi		-16, %arg1, %arg1
 
 	/*
-	 * see if there is anything left that needs to be zeroed in a word 
-	 * move. Since the count was decremented by 16, add 12 to test if 
+	 * see if there is anything left that needs to be zeroed in a word
+	 * move. Since the count was decremented by 16, add 12 to test if
 	 * there are any full word moves left to do.
 	 */
 
@@ -110,7 +110,7 @@ $bzero_cleanup:
 
 $bzero_bytes:
 addib,> -1,%arg1,$bzero_bytes
-stbs,ma %r0,1(%arg0) 
+stbs,ma %r0,1(%arg0)
 
 $bzero_exit:
 	bv,n	%r0(%rp)

Index: src/lib/libc/arch/hppa/string/ffs.S
diff -u src/lib/libc/arch/hppa/string/ffs.S:1.3 src/lib/libc/arch/hppa/string/ffs.S:1.4
--- src/lib/libc/arch/hppa/string/ffs.S:1.3	Sun Jul 18 20:30:04 2004
+++ src/lib/libc/arch/hppa/string/ffs.S	Sun May  3 15:29:22 2020
@@ -1,8 +1,8 @@
-/*	$NetBSD: ffs.S,v 1.3 2004/07/18 20:30:04 chs Exp $	*/
+/*	$NetBSD: ffs.S,v 1.4 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*	$OpenBSD: ffs.S,v 1.3 2001/06/04 23:14:02 mickey Exp $	*/
 
-/* 
+/*
  * Copyright (c) 1990, 1991, 1992, 1994, The University of Utah and
  * the Computer Systems Laboratory at the University of Utah (CSL).
  * All rights reserved.
Index: src/lib/libc/arch/hppa/string/strlcpy.S
diff -u src/lib/libc/arch/hppa/string/strlcpy.S:1.3 src/lib/libc/arch/hppa/string/strlcpy.S:1.4
--- src/lib/libc/arch/hppa/string/strlcpy.S:1.3	Mon Apr 28 20:22:56 2008
+++ src/lib/libc/arch/hppa/string/strlcpy.S	Sun May  3 15:29:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: strlcpy.S,v 1.3 2008/04/28 20:22:56 martin Exp $	*/
+/*	$NetBSD: strlcpy.S,v 1.4 2020/05/03 15:29:22 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,9 +30,9 @@
  */
 
 #include 
- 
-#if defined(LIBC_SCCS) && !defined(lint) 
-RCSID("$NetBSD: strlcpy.S,v 1.3 2008/04/28 20:22:56 martin Exp $")
+
+#if defined(LIBC_SCCS) && !defined(lint)
+RCSID("$NetBSD: strlcpy.S,v 1.4 2020/05/03 15:29:22 skrll E

CVS commit: src/lib/libc/arch

2020-01-27 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Mon Jan 27 22:08:08 UTC 2020

Modified Files:
src/lib/libc/arch/i386/string: Makefile.inc
src/lib/libc/arch/x86_64/string: Makefile.inc

Log Message:
Make x86 use the C versions of bcmp() and memcmp().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/i386/string/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/x86_64/string/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/i386/string/Makefile.inc
diff -u src/lib/libc/arch/i386/string/Makefile.inc:1.5 src/lib/libc/arch/i386/string/Makefile.inc:1.6
--- src/lib/libc/arch/i386/string/Makefile.inc:1.5	Thu Jul 30 20:57:16 2009
+++ src/lib/libc/arch/i386/string/Makefile.inc	Mon Jan 27 22:08:08 2020
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile.inc,v 1.5 2009/07/30 20:57:16 dsl Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2020/01/27 22:08:08 ad Exp $
 
 # objects built from assembler sources
-SRCS+=	bcmp.S bcopy.S bzero.S ffs.S memchr.S memcmp.S \
+SRCS+=	bcopy.S bzero.S ffs.S memchr.S \
 	memcpy.S memmove.S memset.S strcat.S strchr.S \
 	strcmp.S strcpy.S strlen.S strncmp.S strrchr.S swab.S

Index: src/lib/libc/arch/x86_64/string/Makefile.inc
diff -u src/lib/libc/arch/x86_64/string/Makefile.inc:1.6 src/lib/libc/arch/x86_64/string/Makefile.inc:1.7
--- src/lib/libc/arch/x86_64/string/Makefile.inc:1.6	Sun Nov 24 03:50:17 2013
+++ src/lib/libc/arch/x86_64/string/Makefile.inc	Mon Jan 27 22:08:08 2020
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.6 2013/11/24 03:50:17 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2020/01/27 22:08:08 ad Exp $
 
 # objects built from assembler sources
-SRCS+=	bcmp.S bcopy.S ffs.S memchr.S memcmp.S \
+SRCS+=	bcopy.S ffs.S memchr.S  \
 	memcpy.S memmove.S memset.S strcat.S strchr.S \
 	strcmp.S strcpy.S strlen.S strncmp.S strrchr.S swab.S
 NO_SRCS+= bzero.c



CVS commit: src/lib/libc/arch/vax/string

2020-01-23 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan 23 16:34:12 UTC 2020

Modified Files:
src/lib/libc/arch/vax/string: index.S

Log Message:
Fix name of keyword so it will worwk correctly.  :)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/string/index.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/vax/string/index.S
diff -u src/lib/libc/arch/vax/string/index.S:1.4 src/lib/libc/arch/vax/string/index.S:1.5
--- src/lib/libc/arch/vax/string/index.S:1.4	Tue Jan 25 02:38:15 2011
+++ src/lib/libc/arch/vax/string/index.S	Thu Jan 23 16:34:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: index.S,v 1.4 2011/01/25 02:38:15 matt Exp $	*/
+/*	$NetBSD: index.S,v 1.5 2020/01/23 16:34:12 pgoyette Exp $	*/
 /*
  * Copyright (c) 1980, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -39,7 +39,7 @@
 #include "DEFS.h"
 
 #ifdef LIBC_SCCS
-RCSID("$NetSBD$")
+RCSID("$NetBSD: index.S,v 1.5 2020/01/23 16:34:12 pgoyette Exp $")
 #endif
 
 /* Alas not quite twice as fast as the generic C version on a uvax2 */



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

2019-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec  2 01:38:54 UTC 2019

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

Log Message:
Add cfi annotations so that gdb can unwind the stack through signal handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/x86_64/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/x86_64/sys/__sigtramp2.S
diff -u src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.6 src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.7
--- src/lib/libc/arch/x86_64/sys/__sigtramp2.S:1.6	Thu May 22 11:01:57 2014
+++ src/lib/libc/arch/x86_64/sys/__sigtramp2.S	Sun Dec  1 20:38:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.6 2014/05/22 15:01:57 uebayasi Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.7 2019/12/02 01:38:54 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,10 +42,13 @@
  * the signal; the kernel calls the signal handler directly.
  */
 NENTRY(__sigtramp_siginfo_2)
+	.cfi_startproc
+	.cfi_def_cfa rsp, 8
 	movq	%r15,%rdi
 	movq	$SYS_setcontext, %rax
 	syscall
 	movq	$-1,%rdi /* if we return here, something is wrong */
 	movq	$SYS_exit, %rax
 	syscall
+	.cfi_endproc
 END(__sigtramp_siginfo_2)



CVS commit: src/lib/libc/arch/riscv/gdtoa

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 08:04:23 UTC 2019

Modified Files:
src/lib/libc/arch/riscv/gdtoa: Makefile.inc

Log Message:
revert previously. we want riscv32 to have 128 bit long double...
shall fix the compiler instead.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gdtoa/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/riscv/gdtoa/Makefile.inc
diff -u src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.3 src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.4
--- src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.3	Tue Apr 16 07:32:30 2019
+++ src/lib/libc/arch/riscv/gdtoa/Makefile.inc	Tue Apr 16 08:04:23 2019
@@ -1,8 +1,5 @@
-#	$NetBSD: Makefile.inc,v 1.3 2019/04/16 07:32:30 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.4 2019/04/16 08:04:23 mrg Exp $
 
-SRCS+=	strtof.c
+SRCS+=	strtof.c strtold_pQ.c
 SRCS+=	strtopQ.c
 
-.if ${MACHINE_ARCH} == "riscv64"
-SRCS+=	strtold_pQ.c
-.endif



CVS commit: src/lib/libc/arch/riscv/gdtoa

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 07:32:30 UTC 2019

Modified Files:
src/lib/libc/arch/riscv/gdtoa: Makefile.inc

Log Message:
risc32 doesn't want long double specific versions


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/gdtoa/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/riscv/gdtoa/Makefile.inc
diff -u src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.2 src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.3
--- src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.2	Mon Apr 15 18:41:06 2019
+++ src/lib/libc/arch/riscv/gdtoa/Makefile.inc	Tue Apr 16 07:32:30 2019
@@ -1,5 +1,8 @@
-#	$NetBSD: Makefile.inc,v 1.2 2019/04/15 18:41:06 maya Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2019/04/16 07:32:30 mrg Exp $
 
-SRCS+=	strtof.c strtold_pQ.c
+SRCS+=	strtof.c
 SRCS+=	strtopQ.c
 
+.if ${MACHINE_ARCH} == "riscv64"
+SRCS+=	strtold_pQ.c
+.endif



CVS commit: src/lib/libc/arch/riscv/gdtoa

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 18:41:06 UTC 2019

Modified Files:
src/lib/libc/arch/riscv/gdtoa: Makefile.inc

Log Message:
Cargo cult follow the other 128bit long double architecture (sparc64).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/gdtoa/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/riscv/gdtoa/Makefile.inc
diff -u src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.1 src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.2
--- src/lib/libc/arch/riscv/gdtoa/Makefile.inc:1.1	Fri Sep 19 17:36:25 2014
+++ src/lib/libc/arch/riscv/gdtoa/Makefile.inc	Mon Apr 15 18:41:06 2019
@@ -1,3 +1,5 @@
-#	$NetBSD: Makefile.inc,v 1.1 2014/09/19 17:36:25 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2019/04/15 18:41:06 maya Exp $
+
+SRCS+=	strtof.c strtold_pQ.c
+SRCS+=	strtopQ.c
 
-SRCS+=	strtof.c



CVS commit: src/lib/libc/arch/riscv/gdtoa

2019-04-14 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Apr 14 19:25:27 UTC 2019

Modified Files:
src/lib/libc/arch/riscv/gdtoa: gd_qnan.h

Log Message:
Provide a definition of quiet NaN for RISC-V, and a reference to where
it comes from.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/gdtoa/gd_qnan.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/riscv/gdtoa/gd_qnan.h
diff -u src/lib/libc/arch/riscv/gdtoa/gd_qnan.h:1.1 src/lib/libc/arch/riscv/gdtoa/gd_qnan.h:1.2
--- src/lib/libc/arch/riscv/gdtoa/gd_qnan.h:1.1	Fri Sep 19 17:36:25 2014
+++ src/lib/libc/arch/riscv/gdtoa/gd_qnan.h	Sun Apr 14 19:25:27 2019
@@ -1,5 +1,19 @@
-/* $NetBSD: gd_qnan.h,v 1.1 2014/09/19 17:36:25 matt Exp $ */
+/* $NetBSD: gd_qnan.h,v 1.2 2019/04/14 19:25:27 maya Exp $ */
 
-#define f_QNAN 0x7fe0
+/* 
+ * The RISC-V Instruction Set Manual Volume I: User-Level ISA
+ * Document Version 2.2
+ *
+ * 8.3 NaN Generation and Propagation
+ *
+ * The canonical NaN has a positive sign and all significand bits clear except
+ * the MSB, aka the quiet bit.
+ */
+
+#define f_QNAN 0x7fc0
 #define d_QNAN0 0x0
-#define d_QNAN1 0x7ffc
+#define d_QNAN1 0x7ff8
+#define ld_QNAN0 0x0
+#define ld_QNAN1 0x0
+#define ld_QNAN2 0x0
+#define ld_QNAN3 0x7fff8000



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

2019-04-13 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr 13 17:54:13 UTC 2019

Modified Files:
src/lib/libc/arch/riscv/gen: Makefile.inc

Log Message:
build the generic 128bit long double code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/riscv/gen/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/riscv/gen/Makefile.inc
diff -u src/lib/libc/arch/riscv/gen/Makefile.inc:1.1 src/lib/libc/arch/riscv/gen/Makefile.inc:1.2
--- src/lib/libc/arch/riscv/gen/Makefile.inc:1.1	Fri Sep 19 17:36:25 2014
+++ src/lib/libc/arch/riscv/gen/Makefile.inc	Sat Apr 13 17:54:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.1 2014/09/19 17:36:25 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2019/04/13 17:54:13 maya Exp $
 
 SRCS+=	__setjmp14.S __sigsetjmp14.S _setjmp.S
 SRCS+=	bswap16.c bswap32.c bswap64.c
@@ -6,12 +6,12 @@ SRCS+=	flt_rounds.c
 SRCS+=  _lwp.c makecontext.c resumecontext.c swapcontext.S
 
 # Common ieee754 constants and functions
-SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c
-SRCS+=	fpclassifyf_ieee754.c fpclassifyd_ieee754.c
-SRCS+=	isinff_ieee754.c isinfd_ieee754.c
-SRCS+=	isnanf_ieee754.c isnand_ieee754.c
-SRCS+=	isfinitef_ieee754.c isfinited_ieee754.c
-SRCS+=	signbitf_ieee754.c signbitd_ieee754.c
+SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_ieee754.c
+SRCS+=	fpclassifyf_ieee754.c fpclassifyd_ieee754.c fpclassifyl_ieee754.c
+SRCS+=	isinff_ieee754.c isinfd_ieee754.c isinfl_ieee754.c
+SRCS+=	isnanf_ieee754.c isnand_ieee754.c isnanl_ieee754.c
+SRCS+=	isfinitef_ieee754.c isfinited_ieee754.c isfinitel_ieee754.c
+SRCS+=	signbitf_ieee754.c signbitd_ieee754.c signbitl_ieee754.c
 SRCS+=	fabs_ieee754.c
 
 SRCS+=	nanf.c



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

2019-04-13 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Apr 13 16:08:54 UTC 2019

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

Log Message:
Looks like libc is too big to be able to use j. use a longer distance jump


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/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/riscv/SYS.h
diff -u src/lib/libc/arch/riscv/SYS.h:1.2 src/lib/libc/arch/riscv/SYS.h:1.3
--- src/lib/libc/arch/riscv/SYS.h:1.2	Fri Mar 27 06:44:28 2015
+++ src/lib/libc/arch/riscv/SYS.h	Sat Apr 13 16:08:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: SYS.h,v 1.2 2015/03/27 06:44:28 matt Exp $ */
+/*	$NetBSD: SYS.h,v 1.3 2019/04/13 16:08:54 maya Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include 
 
 #define SYSTRAP(x)		li	t6,SYS_ ## x; scall
-#define	JUMP_TO_CERROR()	j	_C_LABEL(__cerror)
+#define	JUMP_TO_CERROR()	tail	_C_LABEL(__cerror)
 
 /*
  * Do a syscall that cannot fail (sync, get{p,u,g,eu,eg)id)



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

2019-03-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  9 02:50:08 UTC 2019

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

Log Message:
Fix previous... We need to deal with a conditional branch.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/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/aarch64/SYS.h
diff -u src/lib/libc/arch/aarch64/SYS.h:1.2 src/lib/libc/arch/aarch64/SYS.h:1.3
--- src/lib/libc/arch/aarch64/SYS.h:1.2	Fri Mar  8 21:33:02 2019
+++ src/lib/libc/arch/aarch64/SYS.h	Fri Mar  8 21:50:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: SYS.h,v 1.2 2019/03/09 02:33:02 christos Exp $ */
+/* $NetBSD: SYS.h,v 1.3 2019/03/09 02:50:07 christos Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -43,7 +43,9 @@
 	SYSTRAP(y)
 
 #define _INVOKE_CERROR()		\
-	b	_C_LABEL(__cerror)
+	b.cc	1f;			\
+	b	_C_LABEL(__cerror);	\
+1:
 
 #define _SYSCALL(x, y)			\
 	_SYSCALL_NOERROR(x,y);		\



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

2019-03-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar  9 02:33:02 UTC 2019

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

Log Message:
We don't fit anymore thanks to jemalloc:
relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `cerror'


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/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/aarch64/SYS.h
diff -u src/lib/libc/arch/aarch64/SYS.h:1.1 src/lib/libc/arch/aarch64/SYS.h:1.2
--- src/lib/libc/arch/aarch64/SYS.h:1.1	Sun Aug 10 01:47:36 2014
+++ src/lib/libc/arch/aarch64/SYS.h	Fri Mar  8 21:33:02 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: SYS.h,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: SYS.h,v 1.2 2019/03/09 02:33:02 christos Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 	SYSTRAP(y)
 
 #define _INVOKE_CERROR()		\
-	b.cs	_C_LABEL(__cerror)
+	b	_C_LABEL(__cerror)
 
 #define _SYSCALL(x, y)			\
 	_SYSCALL_NOERROR(x,y);		\



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

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb  5 13:02:36 UTC 2019

Modified Files:
src/lib/libc/arch/aarch64/sys: brk.S

Log Message:
use adrp not adr, since the data is not pc-rel.  fixes brk(2).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/sys/brk.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/aarch64/sys/brk.S
diff -u src/lib/libc/arch/aarch64/sys/brk.S:1.1 src/lib/libc/arch/aarch64/sys/brk.S:1.2
--- src/lib/libc/arch/aarch64/sys/brk.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/brk.S	Tue Feb  5 13:02:35 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: brk.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: brk.S,v 1.2 2019/02/05 13:02:35 mrg Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ _C_LABEL(__minbrk):
  * Change the data segment size
  */
 ENTRY(_brk)
-	adr	x9, _C_LABEL(__minbrk)
+	adrp	x9, _C_LABEL(__minbrk)
 	ldr	x10, [x9, #:lo12:_C_LABEL(__minbrk)]
 
 	/*
@@ -63,7 +63,7 @@ ENTRY(_brk)
 	_INVOKE_CERROR()
 
 	/* Store the new address in curbrk */
-	adr	x9, _C_LABEL(__curbrk)
+	adrp	x9, _C_LABEL(__curbrk)
 	str	x11, [x9, #:lo12:_C_LABEL(__curbrk)]
 
 	/* Return 0 for success */



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

2019-01-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jan 27 02:42:32 UTC 2019

Modified Files:
src/lib/libc/arch/m68k/gen: fabs.S

Log Message:
fix another mergeo


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/m68k/gen/fabs.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/m68k/gen/fabs.S
diff -u src/lib/libc/arch/m68k/gen/fabs.S:1.13 src/lib/libc/arch/m68k/gen/fabs.S:1.14
--- src/lib/libc/arch/m68k/gen/fabs.S:1.13	Sun Jan 27 02:08:35 2019
+++ src/lib/libc/arch/m68k/gen/fabs.S	Sun Jan 27 02:42:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fabs.S,v 1.13 2019/01/27 02:08:35 pgoyette Exp $	*/
+/*	$NetBSD: fabs.S,v 1.14 2019/01/27 02:42:32 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -32,11 +32,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: fabs.S,v 1.13 2019/01/27 02:08:35 pgoyette Exp $")
-
-#ifndef __HAVE_LONG_DOUBLE
-STRONG_ALIAS(fabsl, fabs)
-#endif
+RCSID("$NetBSD: fabs.S,v 1.14 2019/01/27 02:42:32 dholland Exp $")
 
 #ifndef __HAVE_LONG_DOUBLE
 STRONG_ALIAS(fabsl, fabs)



CVS commit: src/lib/libc/arch/aarch64/softfloat

2018-12-06 Thread Tom Ivar Helbekkmo
Module Name:src
Committed By:   tih
Date:   Thu Dec  6 19:17:13 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/softfloat: softfloat.h

Log Message:
Summary: Align softfloat float128 with libgcc.

While libgcc adapts its float128 data structure to the endianness of
the architecture, the softfloat code in libc didn't.  With both of
them handling the same values, softfloat must follow the toolchain.

OK: riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/softfloat/softfloat.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/aarch64/softfloat/softfloat.h
diff -u src/lib/libc/arch/aarch64/softfloat/softfloat.h:1.1 src/lib/libc/arch/aarch64/softfloat/softfloat.h:1.2
--- src/lib/libc/arch/aarch64/softfloat/softfloat.h:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/softfloat/softfloat.h	Thu Dec  6 19:17:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: softfloat.h,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: softfloat.h,v 1.2 2018/12/06 19:17:13 tih Exp $ */
 
 /* This is a derivative work. */
 
@@ -46,6 +46,7 @@ the `FLOAT128' macro and the quadruple-p
 
 #include "softfloat-qp.h"
 
+#include 
 #include 
 
 /*
@@ -63,7 +64,11 @@ typedef struct {
 #endif
 #ifdef FLOAT128
 typedef struct {
+#if _BYTE_ORDER == _BIG_ENDIAN
 unsigned long long high, low;
+#else
+unsigned long long low, high;
+#endif
 } float128;
 #endif
 



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

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 12:39:19 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: swapcontext.S

Log Message:
Update comments to help explain what's going on


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/gen/swapcontext.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/aarch64/gen/swapcontext.S
diff -u src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3 src/lib/libc/arch/aarch64/gen/swapcontext.S:1.4
--- src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3	Fri Nov 23 11:38:07 2018
+++ src/lib/libc/arch/aarch64/gen/swapcontext.S	Fri Nov 23 12:39:18 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $ */
+/* $NetBSD: swapcontext.S,v 1.4 2018/11/23 12:39:18 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.4 2018/11/23 12:39:18 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 /* LINTSTUB: int swapcontext(ucontext_t * restrict, ucontext_t * restrict); */
@@ -42,12 +42,12 @@ ENTRY(swapcontext)
 	sub	sp, sp, #32		/* allocate stack frame */
 	stp	x29, x30, [sp, #16]	/* save FP & LR */
 	add	x29, sp, #16		/* new FP */
-	stp	x0, x1, [sp, #0]	/* save oucp & ucp */
+	stp	x0, x1, [sp, #0]	/* save oucp (x0) & ucp (x1) */
 
 	bl	_C_LABEL(_getcontext)	/* getcontext(oucp) */
 	mov	x3, x0			/* save return value */
 
-	ldp	x2, x0, [sp, #0]	/* restore oucp & ucp */
+	ldp	x2, x0, [sp, #0]	/* load oucp (x2) & ucp (x0) */
 	ldp	x29, x30, [sp, #16]	/* restore FP & LR */
 	add	sp, sp, #32		/* free stack frame */
 



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

2018-11-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Nov 23 11:38:07 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: swapcontext.S

Log Message:
Fix so the setcontext call is via the PLT and libpthread can override


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/swapcontext.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/aarch64/gen/swapcontext.S
diff -u src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2 src/lib/libc/arch/aarch64/gen/swapcontext.S:1.3
--- src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2	Wed Nov 21 21:04:15 2018
+++ src/lib/libc/arch/aarch64/gen/swapcontext.S	Fri Nov 23 11:38:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $ */
+/* $NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.3 2018/11/23 11:38:07 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 /* LINTSTUB: int swapcontext(ucontext_t * restrict, ucontext_t * restrict); */
@@ -58,7 +58,9 @@ ENTRY(swapcontext)
 	str	x4, [x2, #_UC_REGS_SP]	/* Adjust saved SP. */
 	str	x30, [x2, #_UC_REGS_PC]	/* Adjust saved PC. */
 
-	cbz	x3, _C_LABEL(setcontext)/* setcontext if getcontext succeeded */
+	cbnz	x3, 1f
+	b	_C_LABEL(setcontext)	/* setcontext if getcontext succeeded */
+1:
 	mov	x0, x3			/* restore getcontext return value */
 	ret/* return on error from getcontext */
 END(swapcontext)



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

2018-11-22 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Nov 22 08:30:58 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/sys: __clone.S

Log Message:
fix condition code. x1==0 is parent.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/sys/__clone.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/aarch64/sys/__clone.S
diff -u src/lib/libc/arch/aarch64/sys/__clone.S:1.1 src/lib/libc/arch/aarch64/sys/__clone.S:1.2
--- src/lib/libc/arch/aarch64/sys/__clone.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/__clone.S	Thu Nov 22 08:30:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: __clone.S,v 1.2 2018/11/22 08:30:58 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@ ENTRY(__clone)
 	 * x0 == pid of child in parent, x0 == pid of parent in child.
 	 */
 	/* if this is the parent then just return the pid */
-	cbnz	x1, 1f
+	cbz	x1, 1f
 
 	/*
 	 * This is the child



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

2018-11-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 21 21:24:42 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: _lwp.c

Log Message:
_REG_LR should be _lwp_exit


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/_lwp.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/aarch64/gen/_lwp.c
diff -u src/lib/libc/arch/aarch64/gen/_lwp.c:1.2 src/lib/libc/arch/aarch64/gen/_lwp.c:1.3
--- src/lib/libc/arch/aarch64/gen/_lwp.c:1.2	Sat Aug  4 10:22:09 2018
+++ src/lib/libc/arch/aarch64/gen/_lwp.c	Wed Nov 21 21:24:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: _lwp.c,v 1.2 2018/08/04 10:22:09 ryo Exp $ */
+/* $NetBSD: _lwp.c,v 1.3 2018/11/21 21:24:42 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.2 2018/08/04 10:22:09 ryo Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.3 2018/11/21 21:24:42 skrll Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -58,7 +58,7 @@ _lwp_makecontext(ucontext_t *u, void (*s
 
 	u->uc_mcontext.__gregs[_REG_X0] = (__greg_t)(uintptr_t)arg;
 	u->uc_mcontext.__gregs[_REG_SP] = ((__greg_t)sp) & -16;
-	u->uc_mcontext.__gregs[_REG_X29] = (__greg_t)(uintptr_t)_lwp_exit;
+	u->uc_mcontext.__gregs[_REG_LR] = (__greg_t)(uintptr_t)_lwp_exit;
 	u->uc_mcontext.__gregs[_REG_PC] = (__greg_t)(uintptr_t)start;
 	u->uc_mcontext.__gregs[_REG_TPIDR] = (__greg_t)(uintptr_t)private;
 	u->uc_flags |= _UC_TLSBASE;



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

2018-11-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 21 21:04:15 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: swapcontext.S

Log Message:
Fix some register names in comments


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/swapcontext.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/aarch64/gen/swapcontext.S
diff -u src/lib/libc/arch/aarch64/gen/swapcontext.S:1.1 src/lib/libc/arch/aarch64/gen/swapcontext.S:1.2
--- src/lib/libc/arch/aarch64/gen/swapcontext.S:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/swapcontext.S	Wed Nov 21 21:04:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: swapcontext.S,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,14 +33,14 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.1 2014/08/10 05:47:36 matt Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.2 2018/11/21 21:04:15 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 /* LINTSTUB: int swapcontext(ucontext_t * restrict, ucontext_t * restrict); */
 
 ENTRY(swapcontext)
 	sub	sp, sp, #32		/* allocate stack frame */
-	stp	x29, x30, [sp, #16]	/* save FP & RA */
+	stp	x29, x30, [sp, #16]	/* save FP & LR */
 	add	x29, sp, #16		/* new FP */
 	stp	x0, x1, [sp, #0]	/* save oucp & ucp */
 
@@ -48,7 +48,7 @@ ENTRY(swapcontext)
 	mov	x3, x0			/* save return value */
 
 	ldp	x2, x0, [sp, #0]	/* restore oucp & ucp */
-	ldp	x29, x30, [sp, #16]	/* restore FP & RA */
+	ldp	x29, x30, [sp, #16]	/* restore FP & LR */
 	add	sp, sp, #32		/* free stack frame */
 
 	/*
@@ -56,7 +56,7 @@ ENTRY(swapcontext)
 	 */
 	mov	x4, sp			/* Get SP */
 	str	x4, [x2, #_UC_REGS_SP]	/* Adjust saved SP. */
-	str	x30, [x2, #_UC_REGS_PC]	/* Adjust saved LR. */
+	str	x30, [x2, #_UC_REGS_PC]	/* Adjust saved PC. */
 
 	cbz	x3, _C_LABEL(setcontext)/* setcontext if getcontext succeeded */
 	mov	x0, x3			/* restore getcontext return value */



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

2018-11-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 21 21:01:41 UTC 2018

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

Log Message:
Fix a comment


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/arm/gen/swapcontext.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/swapcontext.S
diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.14 src/lib/libc/arch/arm/gen/swapcontext.S:1.15
--- src/lib/libc/arch/arm/gen/swapcontext.S:1.14	Sat Nov 30 20:20:42 2013
+++ src/lib/libc/arch/arm/gen/swapcontext.S	Wed Nov 21 21:01:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.14 2013/11/30 20:20:42 joerg Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include "assym.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-RCSID("$NetBSD: swapcontext.S,v 1.14 2013/11/30 20:20:42 joerg Exp $")
+RCSID("$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 ENTRY(swapcontext)
@@ -70,7 +70,7 @@ ENTRY(swapcontext)
 #endif
 #if !defined(__thumb__)
 	str	sp, [r0, #_UC_REGS_SP]	/* Adjust saved SP. */
-	str	lr, [r0, #_UC_REGS_PC]	/* Adjust saved SP. */
+	str	lr, [r0, #_UC_REGS_PC]	/* Adjust saved PC. */
 #else
 	mov	r2, sp
 	str	r2, [r0, #_UC_REGS_SP]	/* Adjust saved SP. */



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

2018-11-16 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Nov 16 10:51:08 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: makecontext.c

Log Message:
fix type of argument for va_arg; don't round to 32bit.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/makecontext.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/aarch64/gen/makecontext.c
diff -u src/lib/libc/arch/aarch64/gen/makecontext.c:1.1 src/lib/libc/arch/aarch64/gen/makecontext.c:1.2
--- src/lib/libc/arch/aarch64/gen/makecontext.c:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/makecontext.c	Fri Nov 16 10:51:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: makecontext.c,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: makecontext.c,v 1.2 2018/11/16 10:51:08 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.1 2014/08/10 05:47:36 matt Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.2 2018/11/16 10:51:08 ryo Exp $");
 #endif
 
 #include 
@@ -63,9 +63,9 @@ makecontext(ucontext_t *ucp, void (*func
 	va_list ap;
 	va_start(ap, argc);
 
-	/* Pass up to four arguments in r0-3. */
+	/* Pass up to eight arguments in x0-x7. */
 	for (int i = 0; i < argc && i < 8; i++) {
-		gr[_REG_X0 + i] = va_arg(ap, int);
+		gr[_REG_X0 + i] = va_arg(ap, __greg_t);
 	}
 
 	/* Pass any additional arguments on the stack. */



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

2018-11-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Nov  8 18:19:37 UTC 2018

Modified Files:
src/lib/libc/arch/vax/gen: Makefile.inc
Added Files:
src/lib/libc/arch/vax/gen: fabsf.S

Log Message:
Attempt to implement fabsf by copying fabs and s/d/f/g.

Vax wizards, please vaxinate if I flubbed this!


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/vax/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/vax/gen/fabsf.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/vax/gen/Makefile.inc
diff -u src/lib/libc/arch/vax/gen/Makefile.inc:1.17 src/lib/libc/arch/vax/gen/Makefile.inc:1.18
--- src/lib/libc/arch/vax/gen/Makefile.inc:1.17	Tue Jul  6 05:59:52 2010
+++ src/lib/libc/arch/vax/gen/Makefile.inc	Thu Nov  8 18:19:37 2018
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile.inc,v 1.17 2010/07/06 05:59:52 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.18 2018/11/08 18:19:37 riastradh Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S bswap64.S \
-	fabs.S frexp.c \
+	fabs.S fabsf.S frexp.c \
 	fpclassifyf.c fpclassifyd.c \
 	infinityf.c infinity.c infinityl.c \
 	isfinitef.c isfinited.c \

Added files:

Index: src/lib/libc/arch/vax/gen/fabsf.S
diff -u /dev/null src/lib/libc/arch/vax/gen/fabsf.S:1.1
--- /dev/null	Thu Nov  8 18:19:37 2018
+++ src/lib/libc/arch/vax/gen/fabsf.S	Thu Nov  8 18:19:37 2018
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 "DEFS.h"
+
+#if defined(LIBC_SCCS) && !defined(lint)
+	/* .asciz "@(#)fabs.s	8.1 (Berkeley) 6/4/93" */
+RCSID("$NetBSD: fabsf.S,v 1.1 2018/11/08 18:19:37 riastradh Exp $")
+#endif /* LIBC_SCCS and not lint */
+
+/* fabsf - floating absolute value, float edition */
+
+ENTRY(fabsf, 0)
+	movf	4(%ap),%r0
+	bgeq	1f
+	mnegf	%r0,%r0
+1:
+	ret
+END(fabsf)



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

2018-11-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Nov  8 16:36:16 UTC 2018

Modified Files:
src/lib/libc/arch/ia64/gen: Makefile.inc

Log Message:
Use the generic C fabs/fabsl on ia64 for now to unbreak the build.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/ia64/gen/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/ia64/gen/Makefile.inc
diff -u src/lib/libc/arch/ia64/gen/Makefile.inc:1.8 src/lib/libc/arch/ia64/gen/Makefile.inc:1.9
--- src/lib/libc/arch/ia64/gen/Makefile.inc:1.8	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/Makefile.inc	Thu Nov  8 16:36:16 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.8 2016/08/05 16:40:47 scole Exp $
+#	$NetBSD: Makefile.inc,v 1.9 2018/11/08 16:36:16 riastradh Exp $
 
 SRCS+=	_lwp.c
 SRCS+=	bswap16.c bswap32.c bswap64.c
@@ -10,6 +10,7 @@ SRCS+=	getcontext.S makecontext.c swapco
 
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c
+SRCS+=	fabs_ieee754.c
 SRCS+=	fpclassifyf_ieee754.c fpclassifyd_ieee754.c
 SRCS+=	isfinitef_ieee754.c isfinited_ieee754.c
 SRCS+=	isinff_ieee754.c isinfd_ieee754.c



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

2018-11-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Nov  8 16:31:46 UTC 2018

Modified Files:
src/lib/libc/arch/powerpc64/gen: fabs.c

Log Message:
powerpc64 needs fabsl too.  (Apparently no __HAVE_LONG_DOUBLE?)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/powerpc64/gen/fabs.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/powerpc64/gen/fabs.c
diff -u src/lib/libc/arch/powerpc64/gen/fabs.c:1.2 src/lib/libc/arch/powerpc64/gen/fabs.c:1.3
--- src/lib/libc/arch/powerpc64/gen/fabs.c:1.2	Wed Jul  5 18:07:22 2006
+++ src/lib/libc/arch/powerpc64/gen/fabs.c	Thu Nov  8 16:31:46 2018
@@ -1,7 +1,9 @@
-/*	$NetBSD: fabs.c,v 1.2 2006/07/05 18:07:22 ross Exp $	*/
+/*	$NetBSD: fabs.c,v 1.3 2018/11/08 16:31:46 riastradh Exp $	*/
 
 #include 
 
+__strong_alias(fabsl, fabs)
+
 double
 fabs(double x)
 {



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

2018-11-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Nov  8 16:29:50 UTC 2018

Modified Files:
src/lib/libc/arch/hppa/gen: fabs.c

Log Message:
Try speling it rite, riasthradhdadhaa or whatever your name is.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/hppa/gen/fabs.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/hppa/gen/fabs.c
diff -u src/lib/libc/arch/hppa/gen/fabs.c:1.5 src/lib/libc/arch/hppa/gen/fabs.c:1.6
--- src/lib/libc/arch/hppa/gen/fabs.c:1.5	Wed Nov  7 22:21:42 2018
+++ src/lib/libc/arch/hppa/gen/fabs.c	Thu Nov  8 16:29:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fabs.c,v 1.5 2018/11/07 22:21:42 riastradh Exp $	*/
+/*	$NetBSD: fabs.c,v 1.6 2018/11/08 16:29:50 riastradh Exp $	*/
 
 /*	$OpenBSD: fabs.c,v 1.3 2002/10/21 18:41:05 mickey Exp $	*/
 
@@ -11,7 +11,7 @@
 #include 
 
 #ifndef __HAVE_LONG_DOUBLE
-__strong_alias(fasbl, fabs)
+__strong_alias(fabsl, fabs)
 #endif
 
 double



CVS commit: src/lib/libc/arch

2018-11-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Nov  7 22:21:42 UTC 2018

Modified Files:
src/lib/libc/arch/alpha/gen: fabs.S
src/lib/libc/arch/hppa/gen: fabs.c
src/lib/libc/arch/m68k/gen: fabs.S
src/lib/libc/arch/mips/gen: fabs.S
src/lib/libc/arch/powerpc/gen: fabs_ieee754.S
src/lib/libc/arch/sparc/gen: fabs.S
src/lib/libc/arch/vax/gen: fabs.S

Log Message:
On ports without __HAVE_LONG_DOUBLE, make fabsl alias fabs.

For some reason, fabs lives in libc, not in libm, and our tests now
detect when fabs or fabsl is missing from libm.  For those ports that
sometimes have long double and sometimes don't, make it conditional.

Still missing: fabs _and_ fabsl on ia64.  Need help from an itanium
wizard!  Other portmasters: Please take a look and see if I missed
any ports that might have long double where this alias will not work.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/alpha/gen/fabs.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/hppa/gen/fabs.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/arch/m68k/gen/fabs.S
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/mips/gen/fabs.S
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/powerpc/gen/fabs_ieee754.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc/gen/fabs.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/gen/fabs.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/alpha/gen/fabs.S
diff -u src/lib/libc/arch/alpha/gen/fabs.S:1.3 src/lib/libc/arch/alpha/gen/fabs.S:1.4
--- src/lib/libc/arch/alpha/gen/fabs.S:1.3	Wed Jun 14 06:49:02 2000
+++ src/lib/libc/arch/alpha/gen/fabs.S	Wed Nov  7 22:21:42 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fabs.S,v 1.3 2000/06/14 06:49:02 cgd Exp $ */
+/* $NetBSD: fabs.S,v 1.4 2018/11/07 22:21:42 riastradh Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -29,6 +29,8 @@
 
 #include 
 
+STRONG_ALIAS(fabsl, fabs)
+
 LEAF(fabs, 1)
 	cpys	fzero, fa0, fv0
 	RET

Index: src/lib/libc/arch/hppa/gen/fabs.c
diff -u src/lib/libc/arch/hppa/gen/fabs.c:1.4 src/lib/libc/arch/hppa/gen/fabs.c:1.5
--- src/lib/libc/arch/hppa/gen/fabs.c:1.4	Sat Dec 24 21:42:32 2005
+++ src/lib/libc/arch/hppa/gen/fabs.c	Wed Nov  7 22:21:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fabs.c,v 1.4 2005/12/24 21:42:32 perry Exp $	*/
+/*	$NetBSD: fabs.c,v 1.5 2018/11/07 22:21:42 riastradh Exp $	*/
 
 /*	$OpenBSD: fabs.c,v 1.3 2002/10/21 18:41:05 mickey Exp $	*/
 
@@ -6,8 +6,14 @@
  * Written by Miodrag Vallat.  Public domain
  */
 
+#include 
+
 #include 
 
+#ifndef __HAVE_LONG_DOUBLE
+__strong_alias(fasbl, fabs)
+#endif
+
 double
 fabs(double val)
 {

Index: src/lib/libc/arch/m68k/gen/fabs.S
diff -u src/lib/libc/arch/m68k/gen/fabs.S:1.11 src/lib/libc/arch/m68k/gen/fabs.S:1.12
--- src/lib/libc/arch/m68k/gen/fabs.S:1.11	Wed Jul 17 06:43:32 2013
+++ src/lib/libc/arch/m68k/gen/fabs.S	Wed Nov  7 22:21:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fabs.S,v 1.11 2013/07/17 06:43:32 matt Exp $	*/
+/*	$NetBSD: fabs.S,v 1.12 2018/11/07 22:21:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,8 +30,13 @@
  */
 
 #include 
+#include 
 
-RCSID("$NetBSD: fabs.S,v 1.11 2013/07/17 06:43:32 matt Exp $")
+RCSID("$NetBSD: fabs.S,v 1.12 2018/11/07 22:21:42 riastradh Exp $")
+
+#ifndef __HAVE_LONG_DOUBLE
+STRONG_ALIAS(fabsl, fabs)
+#endif
 
 ENTRY(fabs)
 #if defined(__SVR4_ABI__) && defined(__HAVE_FPU__)

Index: src/lib/libc/arch/mips/gen/fabs.S
diff -u src/lib/libc/arch/mips/gen/fabs.S:1.8 src/lib/libc/arch/mips/gen/fabs.S:1.9
--- src/lib/libc/arch/mips/gen/fabs.S:1.8	Mon Dec 14 01:07:42 2009
+++ src/lib/libc/arch/mips/gen/fabs.S	Wed Nov  7 22:21:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $	*/
+/*	$NetBSD: fabs.S,v 1.9 2018/11/07 22:21:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -33,18 +33,23 @@
  */
 
 #include 
+#include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
 #if 0
 	RCSID("from: @(#)fabs.s	8.1 (Berkeley) 2/16/94")
 #else
-	RCSID("$NetBSD: fabs.S,v 1.8 2009/12/14 01:07:42 matt Exp $")
+	RCSID("$NetBSD: fabs.S,v 1.9 2018/11/07 22:21:42 riastradh Exp $")
 #endif
 #endif /* LIBC_SCCS and not lint */
 
 
 	.set	noreorder
 
+#ifndef __HAVE_LONG_DOUBLE
+STRONG_ALIAS(fabsl, fabs)
+#endif
+
 /*
  * fabs(x)
  *	double x;

Index: src/lib/libc/arch/powerpc/gen/fabs_ieee754.S
diff -u src/lib/libc/arch/powerpc/gen/fabs_ieee754.S:1.1 src/lib/libc/arch/powerpc/gen/fabs_ieee754.S:1.2
--- src/lib/libc/arch/powerpc/gen/fabs_ieee754.S:1.1	Tue Jan 28 13:47:04 2014
+++ src/lib/libc/arch/powerpc/gen/fabs_ieee754.S	Wed Nov  7 22:21:42 2018
@@ -1,11 +1,13 @@
-/*	$NetBSD: fabs_ieee754.S,v 1.1 2014/01/28 13:47:04 macallan Exp $	*/
+/*	$NetBSD: fabs_ieee754.S,v 1.2 2018/11/07 22:21:42 riastradh Exp $	*/
 
 #include 
 
 #if defined(LIBC_SCCS)
-__RCSID("$NetBSD: fabs_ieee754.S,v 1.1 2014/01/28 13:47:04 macallan Exp $")
+__RCSID("$NetBSD: fabs_

CVS commit: src/lib/libc/arch/aarch64/softfloat

2018-08-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Aug 27 16:46:13 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/softfloat: qp.c

Log Message:
delete __{ge,lt,gt,le,eq,ne,unordt}tf2.
these should not be defined in libc.

pointed out by joerg@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/softfloat/qp.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/aarch64/softfloat/qp.c
diff -u src/lib/libc/arch/aarch64/softfloat/qp.c:1.2 src/lib/libc/arch/aarch64/softfloat/qp.c:1.3
--- src/lib/libc/arch/aarch64/softfloat/qp.c:1.2	Sat Aug 11 10:06:40 2018
+++ src/lib/libc/arch/aarch64/softfloat/qp.c	Mon Aug 27 16:46:13 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: qp.c,v 1.2 2018/08/11 10:06:40 ryo Exp $ */
+/* $NetBSD: qp.c,v 1.3 2018/08/27 16:46:13 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -47,14 +47,6 @@ long double __multf3(long double, long d
 long double __negtf2(long double);
 long double __subtf3(long double, long double);
 
-int __libc_getf2(long double, long double);
-int __libc_lttf2(long double, long double);
-int __libc_gttf2(long double, long double);
-int __libc_letf2(long double, long double);
-int __libc_eqtf2(long double, long double);
-int __libc_netf2(long double, long double);
-int __libc_unordtf2(long double, long double);
-
 double __trunctfdf2(long double);
 float __trunctfsf2(long double);
 
@@ -182,70 +174,6 @@ _Qp_cmpe(float128 *a, float128 *b)
 }
 #endif
 
-#ifdef __weak_alias
-__weak_alias(__eqtf2, __libc_eqtf2)
-__weak_alias(__getf2, __libc_getf2)
-__weak_alias(__gttf2, __libc_gttf2)
-__weak_alias(__letf2, __libc_letf2)
-__weak_alias(__lttf2, __libc_lttf2)
-__weak_alias(__netf2, __libc_netf2)
-__weak_alias(__unordtf2, __libc_unordtf2)
-#endif
-
-int
-__libc_eqtf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	return float128_eq(a.ldblu_f128, b.ldblu_f128);
-}
-
-int
-__libc_getf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	return float128_le(b.ldblu_f128, a.ldblu_f128);
-}
-
-int
-__libc_gttf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	return float128_lt(b.ldblu_f128, a.ldblu_f128);
-}
-
-int
-__libc_letf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	return float128_le(a.ldblu_f128, b.ldblu_f128);
-}
-
-int
-__libc_lttf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	return float128_lt(a.ldblu_f128, b.ldblu_f128);
-}
-
-int
-__libc_netf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	return !float128_eq(a.ldblu_f128, b.ldblu_f128);
-}
-
 float
 __trunctfsf2(long double ld_a)
 {
@@ -371,18 +299,3 @@ __floatditf(int64_t a)
 
 	return c.ldblu_ld;
 }
-
-int
-__libc_unordtf2(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	/*
-	 * The comparison is unordered if either input is a NaN.
-	 * Test for this by comparing each operand with itself.
-	 * We must perform both comparisons to correctly check for
-	 * signalling NaNs.
-	 */
-	return 1 ^ (float128_eq(a.ldblu_f128, a.ldblu_f128) & float128_eq(b.ldblu_f128, b.ldblu_f128));
-}



CVS commit: src/lib/libc/arch/aarch64/softfloat

2018-08-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 11 10:06:41 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/softfloat: qp.c

Log Message:
fix multiple definition of __{ge,lt,gt,le,eq,ne,unordt}tf2 in libc and libgcc.
this fixes the ATF call_once_static, call_once2_static, cxxruntime_static, 
static_destructor_static.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/softfloat/qp.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/aarch64/softfloat/qp.c
diff -u src/lib/libc/arch/aarch64/softfloat/qp.c:1.1 src/lib/libc/arch/aarch64/softfloat/qp.c:1.2
--- src/lib/libc/arch/aarch64/softfloat/qp.c:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/softfloat/qp.c	Sat Aug 11 10:06:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: qp.c,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: qp.c,v 1.2 2018/08/11 10:06:40 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -47,13 +47,13 @@ long double __multf3(long double, long d
 long double __negtf2(long double);
 long double __subtf3(long double, long double);
 
-int __getf2(long double, long double);
-int __lttf2(long double, long double);
-int __gttf2(long double, long double);
-int __letf2(long double, long double);
-int __eqtf2(long double, long double);
-int __netf2(long double, long double);
-int __unordtf2(long double, long double);
+int __libc_getf2(long double, long double);
+int __libc_lttf2(long double, long double);
+int __libc_gttf2(long double, long double);
+int __libc_letf2(long double, long double);
+int __libc_eqtf2(long double, long double);
+int __libc_netf2(long double, long double);
+int __libc_unordtf2(long double, long double);
 
 double __trunctfdf2(long double);
 float __trunctfsf2(long double);
@@ -182,8 +182,18 @@ _Qp_cmpe(float128 *a, float128 *b)
 }
 #endif
 
+#ifdef __weak_alias
+__weak_alias(__eqtf2, __libc_eqtf2)
+__weak_alias(__getf2, __libc_getf2)
+__weak_alias(__gttf2, __libc_gttf2)
+__weak_alias(__letf2, __libc_letf2)
+__weak_alias(__lttf2, __libc_lttf2)
+__weak_alias(__netf2, __libc_netf2)
+__weak_alias(__unordtf2, __libc_unordtf2)
+#endif
+
 int
-__eqtf2(long double ld_a, long double ld_b)
+__libc_eqtf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -192,7 +202,7 @@ __eqtf2(long double ld_a, long double ld
 }
 
 int
-__getf2(long double ld_a, long double ld_b)
+__libc_getf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -201,7 +211,7 @@ __getf2(long double ld_a, long double ld
 }
 
 int
-__gttf2(long double ld_a, long double ld_b)
+__libc_gttf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -210,7 +220,7 @@ __gttf2(long double ld_a, long double ld
 }
 
 int
-__letf2(long double ld_a, long double ld_b)
+__libc_letf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -219,7 +229,7 @@ __letf2(long double ld_a, long double ld
 }
 
 int
-__lttf2(long double ld_a, long double ld_b)
+__libc_lttf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -228,7 +238,7 @@ __lttf2(long double ld_a, long double ld
 }
 
 int
-__netf2(long double ld_a, long double ld_b)
+__libc_netf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
@@ -363,7 +373,7 @@ __floatditf(int64_t a)
 }
 
 int
-__unordtf2(long double ld_a, long double ld_b)
+__libc_unordtf2(long double ld_a, long double ld_b)
 {
 	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
 	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };



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

2018-08-04 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug  4 10:22:09 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: _lwp.c

Log Message:
need to set _UC_TLSBASE of uc_flags for _lwp_makecontext().
pointed out from skrll@. thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/_lwp.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/aarch64/gen/_lwp.c
diff -u src/lib/libc/arch/aarch64/gen/_lwp.c:1.1 src/lib/libc/arch/aarch64/gen/_lwp.c:1.2
--- src/lib/libc/arch/aarch64/gen/_lwp.c:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/_lwp.c	Sat Aug  4 10:22:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: _lwp.c,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: _lwp.c,v 1.2 2018/08/04 10:22:09 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.1 2014/08/10 05:47:36 matt Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.2 2018/08/04 10:22:09 ryo Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -61,4 +61,5 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u->uc_mcontext.__gregs[_REG_X29] = (__greg_t)(uintptr_t)_lwp_exit;
 	u->uc_mcontext.__gregs[_REG_PC] = (__greg_t)(uintptr_t)start;
 	u->uc_mcontext.__gregs[_REG_TPIDR] = (__greg_t)(uintptr_t)private;
+	u->uc_flags |= _UC_TLSBASE;
 }



CVS commit: src/lib/libc/arch/aarch64/gdtoa

2018-08-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Aug  1 19:59:49 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gdtoa: gd_qnan.h

Log Message:
fix long double NaN definition.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gdtoa/gd_qnan.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/aarch64/gdtoa/gd_qnan.h
diff -u src/lib/libc/arch/aarch64/gdtoa/gd_qnan.h:1.1 src/lib/libc/arch/aarch64/gdtoa/gd_qnan.h:1.2
--- src/lib/libc/arch/aarch64/gdtoa/gd_qnan.h:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gdtoa/gd_qnan.h	Wed Aug  1 19:59:49 2018
@@ -1,10 +1,10 @@
-/* $NetBSD: gd_qnan.h,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: gd_qnan.h,v 1.2 2018/08/01 19:59:49 ryo Exp $ */
 
 #define f_QNAN 0x7fc0
 #ifdef __AARCH64EB__
 #define d_QNAN0 0x7ff8
 #define d_QNAN1 0x0
-#define ld_QNAN0 0x7ff8
+#define ld_QNAN0 0x7fff8000
 #define ld_QNAN1 0x0
 #define ld_QNAN2 0x0
 #define ld_QNAN3 0x0
@@ -14,5 +14,5 @@
 #define ld_QNAN0 0x0
 #define ld_QNAN1 0x0
 #define ld_QNAN2 0x0
-#define ld_QNAN3 0x7ff8
+#define ld_QNAN3 0x7fff8000
 #endif



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

2018-07-20 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Jul 20 12:19:07 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/sys: ptrace.S

Log Message:
fix a bug. no need postincrement here.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/sys/ptrace.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/aarch64/sys/ptrace.S
diff -u src/lib/libc/arch/aarch64/sys/ptrace.S:1.1 src/lib/libc/arch/aarch64/sys/ptrace.S:1.2
--- src/lib/libc/arch/aarch64/sys/ptrace.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/ptrace.S	Fri Jul 20 12:19:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: ptrace.S,v 1.2 2018/07/20 12:19:07 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 
 ENTRY(ptrace)
 	sub	sp, sp, #48
-	stp	x29, x30, [sp, #32]!
+	stp	x29, x30, [sp, #32]
 	add	x29, sp, #32
 	stp	x0, x1, [sp, #0]
 	stp	x2, x3, [sp, #16]



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

2018-02-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Feb 28 21:00:02 UTC 2018

Modified Files:
src/lib/libc/arch/powerpc: genassym.cf

Log Message:
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.

(oops, forgot to commit this along with swapcontext.S)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/powerpc/genassym.cf

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/powerpc/genassym.cf
diff -u src/lib/libc/arch/powerpc/genassym.cf:1.4 src/lib/libc/arch/powerpc/genassym.cf:1.5
--- src/lib/libc/arch/powerpc/genassym.cf:1.4	Fri Aug 30 21:28:59 2013
+++ src/lib/libc/arch/powerpc/genassym.cf	Wed Feb 28 21:00:02 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.4 2013/08/30 21:28:59 matt Exp $
+#	$NetBSD: genassym.cf,v 1.5 2018/02/28 21:00:02 uwe Exp $
 
 #
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ define CALLFRAME_R31	offsetof(struct cal
 
 define UC_GREGS_R1	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R1])
 define UC_GREGS_R3	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R3])
+define UC_GREGS_R30	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R30])
 define UC_GREGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
 
 define SIG_BLOCK	SIG_BLOCK



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

2018-02-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Feb 28 20:51:58 UTC 2018

Modified Files:
src/lib/libc/arch/powerpc/gen: swapcontext.S

Log Message:
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/powerpc/gen/swapcontext.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/powerpc/gen/swapcontext.S
diff -u src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7 src/lib/libc/arch/powerpc/gen/swapcontext.S:1.8
--- src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7	Thu Sep 12 15:36:15 2013
+++ src/lib/libc/arch/powerpc/gen/swapcontext.S	Wed Feb 28 20:51:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.8 2018/02/28 20:51:58 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "SYS.h"
 #include "assym.h"
 
-__RCSID("$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $")
+__RCSID("$NetBSD: swapcontext.S,v 1.8 2018/02/28 20:51:58 uwe Exp $")
 
 #define	XCALLFRAMELEN	(((2+3)*SZREG + CALLFRAMELEN - 1) & -CALLFRAMELEN)
 #define	XCALLFRAME_R30	(XCALLFRAMELEN-1*SZREG)
@@ -57,6 +57,10 @@ ENTRY(swapcontext)
 	stw	%r0,UC_GREGS_PC(%r11)		# pc <- lr
 	addi	%r0,%r1,XCALLFRAMELEN
 	stw	%r0,UC_GREGS_R1(%r11)		# adjust sp
+#ifdef __PIC__
+	lwz	%r0,XCALLFRAME_R30(%r1)
+	stw	%r0,UC_GREGS_R30(%r11)		# caller's r30
+#endif
 	lwz	%r3,XCALLFRAME_UCP(%r1)		# load ucp
 	bl	PIC_PLT(_C_LABEL(setcontext))	# setcontext(ucp)
 1:



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

2018-02-12 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Feb 12 22:31:04 UTC 2018

Modified Files:
src/lib/libc/arch/aarch64/gen: sigsetjmp.S

Log Message:
Fix __siglongjmp14().

Fixes SIGINT causing ksh to "longjmp botch", presumably due to incorrect
magic number.
cvs: --


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/sigsetjmp.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/aarch64/gen/sigsetjmp.S
diff -u src/lib/libc/arch/aarch64/gen/sigsetjmp.S:1.1 src/lib/libc/arch/aarch64/gen/sigsetjmp.S:1.2
--- src/lib/libc/arch/aarch64/gen/sigsetjmp.S:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/sigsetjmp.S	Mon Feb 12 22:31:04 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sigsetjmp.S,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: sigsetjmp.S,v 1.2 2018/02/12 22:31:04 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -47,6 +47,6 @@ END(__sigsetjmp14)
 
 ENTRY(__siglongjmp14)
 	ldr	x3, [x0, #_JB_MAGIC]
-	tbz	x3, #0, _C_LABEL(__longjmp14)
+	tbnz	x3, #0, _C_LABEL(__longjmp14)
 	b	_C_LABEL(_longjmp)
 END(__siglongjmp14)



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

2018-02-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Feb  4 18:32:31 UTC 2018

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

Log Message:
lower case 'ret' to avoid macro clash


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/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/aarch64/sys/pipe.S
diff -u src/lib/libc/arch/aarch64/sys/pipe.S:1.1 src/lib/libc/arch/aarch64/sys/pipe.S:1.2
--- src/lib/libc/arch/aarch64/sys/pipe.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/pipe.S	Sun Feb  4 18:32:31 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: pipe.S,v 1.1 2014/08/10 05:47:37 matt Exp $	*/
+/* $NetBSD: pipe.S,v 1.2 2018/02/04 18:32:31 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -39,5 +39,5 @@ ENTRY(_pipe)
 	_INVOKE_CERROR()
 	stp	w0, w1, [x9]
 	mov	w0, wzr
-	RET
+	ret
 END(_pipe)



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

2017-11-28 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Nov 28 13:09:05 UTC 2017

Modified Files:
src/lib/libc/arch/aarch64/gen: _setjmp.S setjmp.S

Log Message:
fix to work
* no need to check x29 != NULL. fp may be NULL.
* don't break in-use register x5.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/_setjmp.S
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/setjmp.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/aarch64/gen/_setjmp.S
diff -u src/lib/libc/arch/aarch64/gen/_setjmp.S:1.2 src/lib/libc/arch/aarch64/gen/_setjmp.S:1.3
--- src/lib/libc/arch/aarch64/gen/_setjmp.S:1.2	Tue Nov 28 09:06:25 2017
+++ src/lib/libc/arch/aarch64/gen/_setjmp.S	Tue Nov 28 13:09:05 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: _setjmp.S,v 1.2 2017/11/28 09:06:25 ryo Exp $ */
+/* $NetBSD: _setjmp.S,v 1.3 2017/11/28 13:09:05 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -83,7 +83,6 @@ ENTRY(_longjmp)
 	ldp	x4, x5, [x0, #_JB_X29]
 
 	cbz	x3, .Lbotch
-	cbz	x4, .Lbotch
 	cbz	x5, .Lbotch
 	cmp	x2, x7
 	b.ne	.Lbotch
@@ -94,8 +93,8 @@ ENTRY(_longjmp)
 	ldp	x25, x26, [x0, #_JB_X25]
 	ldp	x27, x28, [x0, #_JB_X27]
 
-	ldr	x5, [x0, #_JB_TPIDR]
-	msr	tpidr_el0, x5
+	ldr	x2, [x0, #_JB_TPIDR]
+	msr	tpidr_el0, x2
 
 	ldp	d8,  d9,  [x0, #_JB_D8]
 	ldp	d10, d11, [x0, #_JB_D10]

Index: src/lib/libc/arch/aarch64/gen/setjmp.S
diff -u src/lib/libc/arch/aarch64/gen/setjmp.S:1.1 src/lib/libc/arch/aarch64/gen/setjmp.S:1.2
--- src/lib/libc/arch/aarch64/gen/setjmp.S:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/setjmp.S	Tue Nov 28 13:09:05 2017
@@ -1,4 +1,4 @@
-/*.$NetBSD: setjmp.S,v 1.1 2014/08/10 05:47:36 matt Exp $.*/
+/*.$NetBSD: setjmp.S,v 1.2 2017/11/28 13:09:05 ryo Exp $.*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -92,7 +92,6 @@ ENTRY(__longjmp14)
 
 	ldp	x4,  x5,  [x0, #_JB_X29]
 	cbz	x3, .Lbotch
-	cbz	x4, .Lbotch
 	cbz	x5, .Lbotch
 
 	ldp	x19, x20, [x0, #_JB_X19]
@@ -101,8 +100,8 @@ ENTRY(__longjmp14)
 	ldp	x25, x26, [x0, #_JB_X25]
 	ldp	x27, x28, [x0, #_JB_X27]
 
-	ldr	x5, [x0, #_JB_TPIDR]
-	msr	tpidr_el0, x5 
+	ldr	x2, [x0, #_JB_TPIDR]
+	msr	tpidr_el0, x2
 
 	ldp	d8,  d9,  [x0, #_JB_D8]
 	ldp	d10, d11, [x0, #_JB_D10]



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

2017-11-28 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Nov 28 09:06:25 UTC 2017

Modified Files:
src/lib/libc/arch/aarch64/gen: _setjmp.S

Log Message:
KNF. use tab


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/_setjmp.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/aarch64/gen/_setjmp.S
diff -u src/lib/libc/arch/aarch64/gen/_setjmp.S:1.1 src/lib/libc/arch/aarch64/gen/_setjmp.S:1.2
--- src/lib/libc/arch/aarch64/gen/_setjmp.S:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/_setjmp.S	Tue Nov 28 09:06:25 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: _setjmp.S,v 1.1 2014/08/10 05:47:36 matt Exp $ */
+/* $NetBSD: _setjmp.S,v 1.2 2017/11/28 09:06:25 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -71,8 +71,8 @@ ENTRY(_setjmp)
 	stp	d12, d13, [x0, #_JB_D12]
 	stp	d14, d15, [x0, #_JB_D14]
 
-mov	x0, xzr
-ret
+	mov	x0, xzr
+	ret
 END(_setjmp)
 
 ENTRY(_longjmp)
@@ -106,8 +106,8 @@ ENTRY(_longjmp)
 	mov	x29, x4
 	mov	x30, x5
 
-mov	x0, x1
-ret
+	mov	x0, x1
+	ret
 
 	/* validation failed, die die die. */
 .Lbotch:



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

2017-10-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Oct 12 05:51:51 UTC 2017

Modified Files:
src/lib/libc/arch/aarch64/sys: cerror.S

Log Message:
return 0x (= -1). not 0x.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/sys/cerror.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/aarch64/sys/cerror.S
diff -u src/lib/libc/arch/aarch64/sys/cerror.S:1.1 src/lib/libc/arch/aarch64/sys/cerror.S:1.2
--- src/lib/libc/arch/aarch64/sys/cerror.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/cerror.S	Thu Oct 12 05:51:51 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: cerror.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: cerror.S,v 1.2 2017/10/12 05:51:51 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@ ENTRY_NP(__cerror)
 	bl	_C_LABEL(__errno)
 	str	w19, [x0]
 	ldp	x19, x30, [sp], #16
-	mvn	w0,wzr
+	mvn	x0, xzr
 	ret
 	.cfi_endproc
 END(__cerror)



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

2017-03-10 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sat Mar 11 01:25:04 UTC 2017

Modified Files:
src/lib/libc/arch/sh3/gen: flt_rounds.c

Log Message:
fix the mapping table.  this sh3 version was originally copied from arm,
but FP_RP and FP_RM have opposite values on sh3 vs. arm.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sh3/gen/flt_rounds.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/sh3/gen/flt_rounds.c
diff -u src/lib/libc/arch/sh3/gen/flt_rounds.c:1.6 src/lib/libc/arch/sh3/gen/flt_rounds.c:1.7
--- src/lib/libc/arch/sh3/gen/flt_rounds.c:1.6	Thu Mar 19 21:22:59 2015
+++ src/lib/libc/arch/sh3/gen/flt_rounds.c	Sat Mar 11 01:25:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: flt_rounds.c,v 1.6 2015/03/19 21:22:59 joerg Exp $	*/
+/*	$NetBSD: flt_rounds.c,v 1.7 2017/03/11 01:25:04 chs Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe
@@ -33,7 +33,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: flt_rounds.c,v 1.6 2015/03/19 21:22:59 joerg Exp $");
+__RCSID("$NetBSD: flt_rounds.c,v 1.7 2017/03/11 01:25:04 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -42,8 +42,8 @@ __RCSID("$NetBSD: flt_rounds.c,v 1.6 201
 
 static const int map[] = {
 	1,	/* round to nearest */
-	2,	/* round to positive infinity */
-	3,	/* round to negative infinity */
+	3,	/* round to positive infinity */
+	2,	/* round to negative infinity */
 	0	/* round to zero */
 };
 



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

2017-02-26 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Mon Feb 27 06:55:26 UTC 2017

Modified Files:
src/lib/libc/arch/mips/gen: fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
fix asm operands: "ctc1" uses the register as an input, not an output.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/mips/gen/fpsetmask.c \
src/lib/libc/arch/mips/gen/fpsetsticky.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/fpsetround.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/mips/gen/fpsetmask.c
diff -u src/lib/libc/arch/mips/gen/fpsetmask.c:1.9 src/lib/libc/arch/mips/gen/fpsetmask.c:1.10
--- src/lib/libc/arch/mips/gen/fpsetmask.c:1.9	Wed Sep 17 11:02:55 2014
+++ src/lib/libc/arch/mips/gen/fpsetmask.c	Mon Feb 27 06:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.10 2017/02/27 06:55:26 chs Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetmask.c,v 1.9 2014/09/17 11:02:55 joerg Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.10 2017/02/27 06:55:26 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -29,7 +29,7 @@ fpsetmask(fp_except mask)
 	new = old & ~(0x1f << 7); 
 	new |= ((mask & 0x1f) << 7);
 
-	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : "=r" (new));
+	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : : "r" (new));
 
 	return (old >> 7) & 0x1f;
 }
Index: src/lib/libc/arch/mips/gen/fpsetsticky.c
diff -u src/lib/libc/arch/mips/gen/fpsetsticky.c:1.9 src/lib/libc/arch/mips/gen/fpsetsticky.c:1.10
--- src/lib/libc/arch/mips/gen/fpsetsticky.c:1.9	Wed Sep 17 11:02:55 2014
+++ src/lib/libc/arch/mips/gen/fpsetsticky.c	Mon Feb 27 06:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.10 2017/02/27 06:55:26 chs Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetsticky.c,v 1.9 2014/09/17 11:02:55 joerg Exp $");
+__RCSID("$NetBSD: fpsetsticky.c,v 1.10 2017/02/27 06:55:26 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -29,7 +29,7 @@ fpsetsticky(fp_except sticky)
 	new = old & ~(0x1f << 2); 
 	new |= (sticky & 0x1f) << 2;
 
-	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : "=r" (new));
+	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : : "r" (new));
 
 	return (old >> 2) & 0x1f;
 }

Index: src/lib/libc/arch/mips/gen/fpsetround.c
diff -u src/lib/libc/arch/mips/gen/fpsetround.c:1.7 src/lib/libc/arch/mips/gen/fpsetround.c:1.8
--- src/lib/libc/arch/mips/gen/fpsetround.c:1.7	Wed Sep 17 11:02:55 2014
+++ src/lib/libc/arch/mips/gen/fpsetround.c	Mon Feb 27 06:55:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.7 2014/09/17 11:02:55 joerg Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.8 2017/02/27 06:55:26 chs Exp $	*/
 
 /*
  * Written by J.T. Conklin, Apr 11, 1995
@@ -7,7 +7,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.7 2014/09/17 11:02:55 joerg Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.8 2017/02/27 06:55:26 chs Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -29,7 +29,7 @@ fpsetround(fp_rnd rnd_dir)
 	new = old & ~0x03;
 	new |= rnd_dir & 0x03;
 
-	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : "=r" (new));
+	__asm(".set push; .set noat; ctc1 %0,$31; .set pop" : : "r" (new));
 
 	return old & 0x03;
 }



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

2016-12-24 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sat Dec 24 15:23:06 UTC 2016

Modified Files:
src/lib/libc/arch/aarch64/gen: fpgetmask.c fpgetround.c fpgetsticky.c
fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
don't use systm.h header, it's not available to userland.

as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/fpgetmask.c \
src/lib/libc/arch/aarch64/gen/fpgetround.c \
src/lib/libc/arch/aarch64/gen/fpgetsticky.c \
src/lib/libc/arch/aarch64/gen/fpsetmask.c \
src/lib/libc/arch/aarch64/gen/fpsetround.c \
src/lib/libc/arch/aarch64/gen/fpsetsticky.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/aarch64/gen/fpgetmask.c
diff -u src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.1 src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.2
--- src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.1	Sun Jul  5 22:07:09 2015
+++ src/lib/libc/arch/aarch64/gen/fpgetmask.c	Sat Dec 24 15:23:06 2016
@@ -29,10 +29,9 @@
 
 #include 
 
-__RCSID("$NetBSD: fpgetmask.c,v 1.1 2015/07/05 22:07:09 matt Exp $");
+__RCSID("$NetBSD: fpgetmask.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
 
 #include 
-#include 
 #include 
 
 #include "namespace.h"
Index: src/lib/libc/arch/aarch64/gen/fpgetround.c
diff -u src/lib/libc/arch/aarch64/gen/fpgetround.c:1.1 src/lib/libc/arch/aarch64/gen/fpgetround.c:1.2
--- src/lib/libc/arch/aarch64/gen/fpgetround.c:1.1	Sun Jul  5 22:07:09 2015
+++ src/lib/libc/arch/aarch64/gen/fpgetround.c	Sat Dec 24 15:23:06 2016
@@ -29,10 +29,9 @@
 
 #include 
 
-__RCSID("$NetBSD: fpgetround.c,v 1.1 2015/07/05 22:07:09 matt Exp $");
+__RCSID("$NetBSD: fpgetround.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
 
 #include 
-#include 
 #include 
 
 #include "namespace.h"
Index: src/lib/libc/arch/aarch64/gen/fpgetsticky.c
diff -u src/lib/libc/arch/aarch64/gen/fpgetsticky.c:1.1 src/lib/libc/arch/aarch64/gen/fpgetsticky.c:1.2
--- src/lib/libc/arch/aarch64/gen/fpgetsticky.c:1.1	Sun Jul  5 22:07:09 2015
+++ src/lib/libc/arch/aarch64/gen/fpgetsticky.c	Sat Dec 24 15:23:06 2016
@@ -29,10 +29,9 @@
 
 #include 
 
-__RCSID("$NetBSD: fpgetsticky.c,v 1.1 2015/07/05 22:07:09 matt Exp $");
+__RCSID("$NetBSD: fpgetsticky.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
 
 #include 
-#include 
 #include 
 
 #include "namespace.h"
Index: src/lib/libc/arch/aarch64/gen/fpsetmask.c
diff -u src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.1 src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.2
--- src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.1	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetmask.c	Sat Dec 24 15:23:06 2016
@@ -29,10 +29,9 @@
 
 #include 
 
-__RCSID("$NetBSD: fpsetmask.c,v 1.1 2015/07/07 21:40:19 matt Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
 
 #include 
-#include 
 #include 
 
 #include "namespace.h"
Index: src/lib/libc/arch/aarch64/gen/fpsetround.c
diff -u src/lib/libc/arch/aarch64/gen/fpsetround.c:1.1 src/lib/libc/arch/aarch64/gen/fpsetround.c:1.2
--- src/lib/libc/arch/aarch64/gen/fpsetround.c:1.1	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetround.c	Sat Dec 24 15:23:06 2016
@@ -29,10 +29,9 @@
 
 #include 
 
-__RCSID("$NetBSD: fpsetround.c,v 1.1 2015/07/07 21:40:19 matt Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
 
 #include 
-#include 
 #include 
 
 #include "namespace.h"
Index: src/lib/libc/arch/aarch64/gen/fpsetsticky.c
diff -u src/lib/libc/arch/aarch64/gen/fpsetsticky.c:1.1 src/lib/libc/arch/aarch64/gen/fpsetsticky.c:1.2
--- src/lib/libc/arch/aarch64/gen/fpsetsticky.c:1.1	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetsticky.c	Sat Dec 24 15:23:06 2016
@@ -29,10 +29,9 @@
 
 #include 
 
-__RCSID("$NetBSD: fpsetsticky.c,v 1.1 2015/07/07 21:40:19 matt Exp $");
+__RCSID("$NetBSD: fpsetsticky.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
 
 #include 
-#include 
 #include 
 
 #include "namespace.h"



CVS commit: src/lib/libc/arch/powerpc/string

2016-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Dec 19 14:30:23 UTC 2016

Modified Files:
src/lib/libc/arch/powerpc/string: bzero.S

Log Message:
PR/50228: Christian Groessler: fix bzero(ptr, 0) on ppc. Check for 0 length
before jumping to cb_memset like memset does.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/arch/powerpc/string/bzero.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/powerpc/string/bzero.S
diff -u src/lib/libc/arch/powerpc/string/bzero.S:1.14 src/lib/libc/arch/powerpc/string/bzero.S:1.15
--- src/lib/libc/arch/powerpc/string/bzero.S:1.14	Thu Sep 12 11:36:15 2013
+++ src/lib/libc/arch/powerpc/string/bzero.S	Mon Dec 19 09:30:23 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bzero.S,v 1.14 2013/09/12 15:36:15 joerg Exp $ */
+/*	$NetBSD: bzero.S,v 1.15 2016/12/19 14:30:23 christos Exp $ */
 
 /*-
  * Copyright (C) 2001	Martin J. Laubach 
@@ -32,7 +32,7 @@
 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: bzero.S,v 1.14 2013/09/12 15:36:15 joerg Exp $")
+__RCSID("$NetBSD: bzero.S,v 1.15 2016/12/19 14:30:23 christos Exp $")
 #endif /* LIBC_SCCS && !lint */
 
 #include "assym.h"
@@ -54,6 +54,8 @@ __RCSID("$NetBSD: bzero.S,v 1.14 2013/09
 		.align 4
 ENTRY(bzero)
 		li	r_val, 0		/* Value to stuff in */
+		cmplwi	%cr1, %r4, 0		/* Zero length? */
+		beqlr-	%cr1			/* Yes, do nothing */
 		b	cb_memset
 END(bzero)
 



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

2016-12-10 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Sat Dec 10 21:19:15 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/sys: exect.S

Log Message:
Add exect stub so "build.sh distribution" will compile


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/ia64/sys/exect.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/ia64/sys/exect.S
diff -u src/lib/libc/arch/ia64/sys/exect.S:1.1 src/lib/libc/arch/ia64/sys/exect.S:1.2
--- src/lib/libc/arch/ia64/sys/exect.S:1.1	Sun Sep 10 21:22:34 2006
+++ src/lib/libc/arch/ia64/sys/exect.S	Sat Dec 10 21:19:15 2016
@@ -1,3 +1,12 @@
-/* $NetBSD: exect.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+/* $NetBSD: exect.S,v 1.2 2016/12/10 21:19:15 scole Exp $ */
 	
-/* XXX:	 Stub */
\ No newline at end of file
+/* XXX:	 Stub */
+
+#include 
+
+#include "SYS.h"
+
+ENTRY(exect, 3)
+	// XXX break into debugger in ski
+	break.i 1
+END(exect)	



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

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:52:14 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/sys: ptrace.S

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/ia64/sys/ptrace.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/ia64/sys/ptrace.S
diff -u src/lib/libc/arch/ia64/sys/ptrace.S:1.2 src/lib/libc/arch/ia64/sys/ptrace.S:1.3
--- src/lib/libc/arch/ia64/sys/ptrace.S:1.2	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/sys/ptrace.S	Tue Nov 22 22:52:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: ptrace.S,v 1.2 2016/08/05 16:40:47 scole Exp $ */
+/* $NetBSD: ptrace.S,v 1.3 2016/11/22 22:52:14 scole Exp $ */
 	
 /*-
  * Copyright (c) 2006,2016 The NetBSD Foundation, Inc.
@@ -31,6 +31,6 @@
 	
 ENTRY(ptrace,0)
 	/* XXX implement, halt in ski */
-	break.i 0
+	break.i 1
 
 END(ptrace)



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

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:51:53 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/sys: __clone.S

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/ia64/sys/__clone.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/ia64/sys/__clone.S
diff -u src/lib/libc/arch/ia64/sys/__clone.S:1.2 src/lib/libc/arch/ia64/sys/__clone.S:1.3
--- src/lib/libc/arch/ia64/sys/__clone.S:1.2	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/sys/__clone.S	Tue Nov 22 22:51:53 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: __clone.S,v 1.2 2016/08/05 16:40:47 scole Exp $ */
+/* $NetBSD: __clone.S,v 1.3 2016/11/22 22:51:53 scole Exp $ */
 
 /*-
  * Copyright (c) 2006,2016 The NetBSD Foundation, Inc.
@@ -37,6 +37,6 @@ WEAK_ALIAS(clone, __clone)
 
 ENTRY(__clone,4)
 	/* XXX implement, break in ski*/
-	break.i 0
+	break.i 1
 	
 END(__clone)



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

2016-11-22 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Nov 22 22:50:32 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/gen: fpgetsticky.c fpsetsticky.c getcontext.S
makecontext.c swapcontext.S

Log Message:
For ski, break into debugger instead of exiting


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/ia64/gen/fpgetsticky.c \
src/lib/libc/arch/ia64/gen/fpsetsticky.c \
src/lib/libc/arch/ia64/gen/getcontext.S \
src/lib/libc/arch/ia64/gen/makecontext.c \
src/lib/libc/arch/ia64/gen/swapcontext.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/ia64/gen/fpgetsticky.c
diff -u src/lib/libc/arch/ia64/gen/fpgetsticky.c:1.1 src/lib/libc/arch/ia64/gen/fpgetsticky.c:1.2
--- src/lib/libc/arch/ia64/gen/fpgetsticky.c:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/fpgetsticky.c	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@ fp_except_t
 fpgetsticky(void)
 {
   /* XXX implement, pause in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
 
   return (fp_except_t)0;
 }
Index: src/lib/libc/arch/ia64/gen/fpsetsticky.c
diff -u src/lib/libc/arch/ia64/gen/fpsetsticky.c:1.1 src/lib/libc/arch/ia64/gen/fpsetsticky.c:1.2
--- src/lib/libc/arch/ia64/gen/fpsetsticky.c:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/fpsetsticky.c	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@ fp_except_t
 fpsetsticky(fp_except_t sticky)
 {
   /* XXX implement, pause in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
   
   return (fp_except_t)0;
 }
Index: src/lib/libc/arch/ia64/gen/getcontext.S
diff -u src/lib/libc/arch/ia64/gen/getcontext.S:1.1 src/lib/libc/arch/ia64/gen/getcontext.S:1.2
--- src/lib/libc/arch/ia64/gen/getcontext.S:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/getcontext.S	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -35,6 +35,6 @@ WEAK_ALIAS(getcontext, _getcontext)
 ENTRY(_getcontext,0)
 	
 	/* XXX implement, halt in ski */
-	break.i 0
+	break.i 1
 
 END(_getcontext)
Index: src/lib/libc/arch/ia64/gen/makecontext.c
diff -u src/lib/libc/arch/ia64/gen/makecontext.c:1.1 src/lib/libc/arch/ia64/gen/makecontext.c:1.2
--- src/lib/libc/arch/ia64/gen/makecontext.c:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/makecontext.c	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -41,5 +41,5 @@ void
 makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
 {
   /* XXX implement, halt in ski */
-  __asm __volatile("break.i 0");
+  __asm __volatile("break.i 1");
 }
Index: src/lib/libc/arch/ia64/gen/swapcontext.S
diff -u src/lib/libc/arch/ia64/gen/swapcontext.S:1.1 src/lib/libc/arch/ia64/gen/swapcontext.S:1.2
--- src/lib/libc/arch/ia64/gen/swapcontext.S:1.1	Fri Aug  5 16:40:47 2016
+++ src/lib/libc/arch/ia64/gen/swapcontext.S	Tue Nov 22 22:50:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.1 2016/08/05 16:40:47 scole Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.2 2016/11/22 22:50:32 scole Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 ENTRY(swapcontext,0)
 	
 	/* XXX implement, halt in ski */
-	break.i 0
+	break.i 1
 	
 END(swapcontext)
 



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

2016-09-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 06:49:40 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S swapcontext.S

Log Message:
Fix for [on]{32,64}

/usr/tests/lib/libc/sys/t_getcontext
/usr/tests/lib/libc/sys/t_swapcontext
/usr/tests/lib/libc/sys/t_ucontext
/usr/tests/lib/libpthread/t_swapcontext

All pass now.

Changes amount to

- saving GP from caller in context for n{32,64}
- performing (the equivalient of) PIC_PROLOGUE for swapcontext and
  __resumecontext
- Call setcontext via the PLT in __resumecontext


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libc/arch/mips/gen/_resumecontext.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/mips/gen/swapcontext.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/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.10 src/lib/libc/arch/mips/gen/_resumecontext.S:1.11
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.10	Sat Aug 13 08:09:17 2016
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Wed Sep 21 06:49:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.11 2016/09/21 06:49:39 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.11 2016/09/21 06:49:39 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
@@ -44,17 +44,36 @@
 LEAF_NOPROFILE(__resumecontext)
 	/*
 	 * We get here not by a call through $t9 but thru $ra after the
-	 * function passed to makecontext returns.
+	 * function passed to makecontext returns.  Therefore, we need
+	 * to recover gp from ra
 	 */
+#if defined(__mips_o32) || defined(__mips_o64)
+	.set push
+	.set noreorder
+	.cpload	ra
+	.set pop
+#endif
+#if defined(__mips_n32) || defined(__mips_n64)
+	.cpsetup ra, t3, __resumecontext
+#endif
+	
 	PTR_SUBU	sp, sp, UCONTEXT_SIZE		# get space for ucontext
 	move		a0, sp# arg0 for getcontext
 	PTR_S		zero, _OFFSETOF_UC_LINK(a0)	# make sure uc_link is 0
 	SYSTRAP(getcontext)# get context
+
+#if defined(__mips_n32) || defined(__mips_n64)
+	REG_PROLOGUE
+	/* We saved gp in t2 above */
+	REG_S		t3, _OFFSETOF_UC_GREGS_GP(a0)
+	REG_EPILOGUE
+#endif
+
 	PTR_L		a0, _OFFSETOF_UC_LINK(a0)	# linked context?
 	NOP_L
 	beq		a0, zero, 1f			#   nope, exit process
 	nop
-	SYSTRAP(setcontext)#   yes, become it.
+	PIC_TAILCALL(setcontext)			#   yes, become it.
 	/* NOTREACHED (in theory) */
 	li		a0, -1# failure,
 1:

Index: src/lib/libc/arch/mips/gen/swapcontext.S
diff -u src/lib/libc/arch/mips/gen/swapcontext.S:1.6 src/lib/libc/arch/mips/gen/swapcontext.S:1.7
--- src/lib/libc/arch/mips/gen/swapcontext.S:1.6	Wed Sep 21 06:41:42 2016
+++ src/lib/libc/arch/mips/gen/swapcontext.S	Wed Sep 21 06:49:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.7 2016/09/21 06:49:39 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,13 +33,14 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $")
+	RCSID("$NetBSD: swapcontext.S,v 1.7 2016/09/21 06:49:39 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
 
 NESTED(swapcontext, CALLFRAME_SIZ, ra)
 	.mask	0x8030, (CALLFRAME_RA - CALLFRAME_SIZ)
+	PIC_PROLOGUE(swapcontext)
 	PTR_SUBU	sp, sp, CALLFRAME_SIZ
 	PTR_S		ra, CALLFRAME_RA(sp)	# save ra
 	PTR_S		a0, 0(sp)		# stash away oucp
@@ -53,6 +54,10 @@ NESTED(swapcontext, CALLFRAME_SIZ, ra)
 	PTR_ADDIU	v0, sp, CALLFRAME_SIZ
 	REG_PROLOGUE
 	REG_S		zero, _OFFSETOF_UC_GREGS_V0(v1)
+#if defined(__mips_n32) || defined(__mips_n64)
+	/* PIC_PROLOGUE saved gp in t3 */
+	REG_S		t3, _OFFSETOF_UC_GREGS_GP(v1)
+#endif
 	REG_S		ra, _OFFSETOF_UC_GREGS_EPC(v1)
 	REG_S		v0, _OFFSETOF_UC_GREGS_SP(v1)
 	REG_EPILOGUE



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

2016-09-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Sep 21 06:41:42 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: swapcontext.S

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/gen/swapcontext.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/mips/gen/swapcontext.S
diff -u src/lib/libc/arch/mips/gen/swapcontext.S:1.5 src/lib/libc/arch/mips/gen/swapcontext.S:1.6
--- src/lib/libc/arch/mips/gen/swapcontext.S:1.5	Wed Sep 12 02:00:52 2012
+++ src/lib/libc/arch/mips/gen/swapcontext.S	Wed Sep 21 06:41:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.5 2012/09/12 02:00:52 manu Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,11 +33,11 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: swapcontext.S,v 1.5 2012/09/12 02:00:52 manu Exp $")
+	RCSID("$NetBSD: swapcontext.S,v 1.6 2016/09/21 06:41:42 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
-	
+
 NESTED(swapcontext, CALLFRAME_SIZ, ra)
 	.mask	0x8030, (CALLFRAME_RA - CALLFRAME_SIZ)
 	PTR_SUBU	sp, sp, CALLFRAME_SIZ



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

2016-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 13 08:09:17 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S

Log Message:
Add a NOP_L


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/mips/gen/_resumecontext.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/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.9 src/lib/libc/arch/mips/gen/_resumecontext.S:1.10
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.9	Sat Aug 13 07:49:32 2016
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Sat Aug 13 08:09:17 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.10 2016/08/13 08:09:17 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
@@ -51,6 +51,7 @@ LEAF_NOPROFILE(__resumecontext)
 	PTR_S		zero, _OFFSETOF_UC_LINK(a0)	# make sure uc_link is 0
 	SYSTRAP(getcontext)# get context
 	PTR_L		a0, _OFFSETOF_UC_LINK(a0)	# linked context?
+	NOP_L
 	beq		a0, zero, 1f			#   nope, exit process
 	nop
 	SYSTRAP(setcontext)#   yes, become it.



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

2016-08-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 13 07:49:32 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S

Log Message:
PIC_TAILCALL on n32/n64 would mess up GP, so just use SYSTRAP to call
setcontext.

Fixes tests/lib/libc/sys/t_getcontext.c:setcontext_link


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libc/arch/mips/gen/_resumecontext.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/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.8 src/lib/libc/arch/mips/gen/_resumecontext.S:1.9
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.8	Fri Aug 12 15:21:25 2016
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Sat Aug 13 07:49:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.9 2016/08/13 07:49:32 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
@@ -53,7 +53,7 @@ LEAF_NOPROFILE(__resumecontext)
 	PTR_L		a0, _OFFSETOF_UC_LINK(a0)	# linked context?
 	beq		a0, zero, 1f			#   nope, exit process
 	nop
-	PIC_TAILCALL(setcontext)			#   yes, become it.
+	SYSTRAP(setcontext)#   yes, become it.
 	/* NOTREACHED (in theory) */
 	li		a0, -1# failure,
 1:



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

2016-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 12 15:21:25 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: _resumecontext.S

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/_resumecontext.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/mips/gen/_resumecontext.S
diff -u src/lib/libc/arch/mips/gen/_resumecontext.S:1.7 src/lib/libc/arch/mips/gen/_resumecontext.S:1.8
--- src/lib/libc/arch/mips/gen/_resumecontext.S:1.7	Wed Sep 12 02:00:52 2012
+++ src/lib/libc/arch/mips/gen/_resumecontext.S	Fri Aug 12 15:21:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: _resumecontext.S,v 1.7 2012/09/12 02:00:52 manu Exp $	*/
+/*	$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,12 +35,12 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: _resumecontext.S,v 1.7 2012/09/12 02:00:52 manu Exp $")
+	RCSID("$NetBSD: _resumecontext.S,v 1.8 2016/08/12 15:21:25 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 	.set	reorder
 	.hidden	_C_LABEL(__resumecontext)
-	
+
 LEAF_NOPROFILE(__resumecontext)
 	/*
 	 * We get here not by a call through $t9 but thru $ra after the
@@ -55,7 +55,7 @@ LEAF_NOPROFILE(__resumecontext)
 	nop
 	PIC_TAILCALL(setcontext)			#   yes, become it.
 	/* NOTREACHED (in theory) */
-	li		a0, -1# failure, 
+	li		a0, -1# failure,
 1:
 	SYSTRAP(exit)	# all hope is lost.
 	/* NOTREACHED */



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

2016-08-12 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Aug 12 15:26:04 UTC 2016

Modified Files:
src/lib/libc/arch/mips: genassym.cf
src/lib/libc/arch/mips/sys: getcontext.S

Log Message:
Provide _OFFSETOF_UC_GREGS_GP and use _OFFSETOF_UC_GREGS_* in getcontext


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/mips/genassym.cf
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/sys/getcontext.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/mips/genassym.cf
diff -u src/lib/libc/arch/mips/genassym.cf:1.2 src/lib/libc/arch/mips/genassym.cf:1.3
--- src/lib/libc/arch/mips/genassym.cf:1.2	Mon Dec 14 01:07:41 2009
+++ src/lib/libc/arch/mips/genassym.cf	Fri Aug 12 15:26:04 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.2 2009/12/14 01:07:41 matt Exp $
+#	$NetBSD: genassym.cf,v 1.3 2016/08/12 15:26:04 skrll Exp $
 
 #
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -36,8 +36,8 @@ include 
 include 
 include 
 
-define _OFFSETOF_UC_GREGS	offsetof(ucontext_t, uc_mcontext.__gregs[0])
 define _OFFSETOF_UC_GREGS_V0	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_V0])
+define _OFFSETOF_UC_GREGS_GP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_GP])
 define _OFFSETOF_UC_GREGS_SP	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
 define _OFFSETOF_UC_GREGS_EPC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_EPC])
 define _OFFSETOF_UC_LINK	offsetof(ucontext_t, uc_link)

Index: src/lib/libc/arch/mips/sys/getcontext.S
diff -u src/lib/libc/arch/mips/sys/getcontext.S:1.5 src/lib/libc/arch/mips/sys/getcontext.S:1.6
--- src/lib/libc/arch/mips/sys/getcontext.S:1.5	Wed Aug 10 16:45:24 2016
+++ src/lib/libc/arch/mips/sys/getcontext.S	Fri Aug 12 15:26:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.6 2016/08/12 15:26:04 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include 
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $")
+	RCSID("$NetBSD: getcontext.S,v 1.6 2016/08/12 15:26:04 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 #ifdef WEAK_ALIAS
@@ -47,12 +47,12 @@ LEAF(_getcontext)
 	SYSTRAP(getcontext)
 	bne		a3, zero, 1f
 	REG_PROLOGUE
-	REG_S		zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0)
+	REG_S		zero, _OFFSETOF_UC_GREGS_V0(a0)
 #if !defined(__mips_o32)
 	/* PIC_PROLOGUE saved gp in t3 */
-	REG_S		t3, (_OFFSETOF_UC_GREGS + _REG_GP * SZREG)(a0)
+	REG_S		t3, _OFFSETOF_UC_GREGS_GP(a0)
 #endif
-	REG_S		ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0)
+	REG_S		ra, _OFFSETOF_UC_GREGS_EPC(a0)
 	REG_EPILOGUE
 	PIC_RETURN()
 1:



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

2016-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug 10 16:45:24 UTC 2016

Modified Files:
src/lib/libc/arch/mips/sys: getcontext.S

Log Message:
We need to save the GP of the caller in the context for n32/n64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/mips/sys/getcontext.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/mips/sys/getcontext.S
diff -u src/lib/libc/arch/mips/sys/getcontext.S:1.4 src/lib/libc/arch/mips/sys/getcontext.S:1.5
--- src/lib/libc/arch/mips/sys/getcontext.S:1.4	Mon Dec 14 01:07:42 2009
+++ src/lib/libc/arch/mips/sys/getcontext.S	Wed Aug 10 16:45:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: getcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $	*/
+/*	$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include 
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: getcontext.S,v 1.4 2009/12/14 01:07:42 matt Exp $")
+	RCSID("$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $")
 #endif /* SYSLIBC_SCCS && !lint */
 
 #ifdef WEAK_ALIAS
@@ -48,6 +48,10 @@ LEAF(_getcontext)
 	bne		a3, zero, 1f
 	REG_PROLOGUE
 	REG_S		zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0)
+#if !defined(__mips_o32)
+	/* PIC_PROLOGUE saved gp in t3 */
+	REG_S		t3, (_OFFSETOF_UC_GREGS + _REG_GP * SZREG)(a0)
+#endif
 	REG_S		ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0)
 	REG_EPILOGUE
 	PIC_RETURN()



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

2016-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Aug 10 16:40:24 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: makecontext.c

Log Message:
Fix comments


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/gen/makecontext.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/mips/gen/makecontext.c
diff -u src/lib/libc/arch/mips/gen/makecontext.c:1.7 src/lib/libc/arch/mips/gen/makecontext.c:1.8
--- src/lib/libc/arch/mips/gen/makecontext.c:1.7	Tue Sep 20 08:42:29 2011
+++ src/lib/libc/arch/mips/gen/makecontext.c	Wed Aug 10 16:40:24 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: makecontext.c,v 1.7 2011/09/20 08:42:29 joerg Exp $	*/
+/*	$NetBSD: makecontext.c,v 1.8 2016/08/10 16:40:24 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: makecontext.c,v 1.7 2011/09/20 08:42:29 joerg Exp $");
+__RCSID("$NetBSD: makecontext.c,v 1.8 2016/08/10 16:40:24 skrll Exp $");
 #endif
 
 #include 
@@ -85,9 +85,8 @@ makecontext(ucontext_t *ucp, void (*func
 	for (i = 0; i < argc && i < 8; i++)
 		/* LINTED __greg_t is safe */
 		gr[_REG_A0 + i] = va_arg(ap, __greg_t);
-	/* Pass remaining arguments on the stack above the $a0-3 gap. */
+	/* Pass remaining arguments on the stack */
 #endif
-	/* Pass remaining arguments on the stack above the $a0-3 gap. */
 	for (; i < argc; i++)
 		/* LINTED uintptr_t is safe */
 		*sp++ = va_arg(ap, __greg_t);



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

2016-08-05 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Fri Aug  5 16:40:47 UTC 2016

Modified Files:
src/lib/libc/arch/ia64/gen: Makefile.inc
src/lib/libc/arch/ia64/sys: __clone.S ptrace.S
Added Files:
src/lib/libc/arch/ia64/gen: fpgetsticky.c fpsetsticky.c getcontext.S
makecontext.c swapcontext.S

Log Message:
PR port-ia64/51261

Add stubs for ia64 build


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/ia64/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/ia64/gen/fpgetsticky.c \
src/lib/libc/arch/ia64/gen/fpsetsticky.c \
src/lib/libc/arch/ia64/gen/getcontext.S \
src/lib/libc/arch/ia64/gen/makecontext.c \
src/lib/libc/arch/ia64/gen/swapcontext.S
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/ia64/sys/__clone.S \
src/lib/libc/arch/ia64/sys/ptrace.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/ia64/gen/Makefile.inc
diff -u src/lib/libc/arch/ia64/gen/Makefile.inc:1.7 src/lib/libc/arch/ia64/gen/Makefile.inc:1.8
--- src/lib/libc/arch/ia64/gen/Makefile.inc:1.7	Thu Jun 30 09:14:30 2016
+++ src/lib/libc/arch/ia64/gen/Makefile.inc	Fri Aug  5 16:40:47 2016
@@ -1,10 +1,13 @@
-#	$NetBSD: Makefile.inc,v 1.7 2016/06/30 09:14:30 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.8 2016/08/05 16:40:47 scole Exp $
 
 SRCS+=	_lwp.c
 SRCS+=	bswap16.c bswap32.c bswap64.c
 SRCS+=	setjmp.S _setjmp.S sigsetjmp.S
 SRCS+=	flt_rounds.c fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c
 
+SRCS+=	fpgetsticky.c fpsetsticky.c
+SRCS+=	getcontext.S makecontext.c swapcontext.S
+
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_dbl_ieee754.c
 SRCS+=	fpclassifyf_ieee754.c fpclassifyd_ieee754.c

Index: src/lib/libc/arch/ia64/sys/__clone.S
diff -u src/lib/libc/arch/ia64/sys/__clone.S:1.1 src/lib/libc/arch/ia64/sys/__clone.S:1.2
--- src/lib/libc/arch/ia64/sys/__clone.S:1.1	Sun Sep 10 21:22:34 2006
+++ src/lib/libc/arch/ia64/sys/__clone.S	Fri Aug  5 16:40:47 2016
@@ -1,3 +1,42 @@
-/* $NetBSD: __clone.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+/* $NetBSD: __clone.S,v 1.2 2016/08/05 16:40:47 scole Exp $ */
+
+/*-
+ * Copyright (c) 2006,2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* XXX:	 Stub */
+#include 
+
+#include "SYS.h"
+
+#ifdef WEAK_ALIAS
+WEAK_ALIAS(clone, __clone)
+#endif
+
+ENTRY(__clone,4)
+	/* XXX implement, break in ski*/
+	break.i 0
 	
-/* XXX:	 Stub */
\ No newline at end of file
+END(__clone)
Index: src/lib/libc/arch/ia64/sys/ptrace.S
diff -u src/lib/libc/arch/ia64/sys/ptrace.S:1.1 src/lib/libc/arch/ia64/sys/ptrace.S:1.2
--- src/lib/libc/arch/ia64/sys/ptrace.S:1.1	Sun Sep 10 21:22:34 2006
+++ src/lib/libc/arch/ia64/sys/ptrace.S	Fri Aug  5 16:40:47 2016
@@ -1,3 +1,36 @@
-/* $NetBSD: ptrace.S,v 1.1 2006/09/10 21:22:34 cherry Exp $ */
+/* $NetBSD: ptrace.S,v 1.2 2016/08/05 16:40:47 scole Exp $ */
 	
-/* XXX:	 Stub */
\ No newline at end of file
+/*-
+ * Copyright (c) 2006,2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS P

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

2016-07-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul 16 09:51:13 UTC 2016

Modified Files:
src/lib/libc/arch/hppa/gen: __setjmp14.S

Log Message:
No need to define PSW_MBS as machine/psl.h provides it for us


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/hppa/gen/__setjmp14.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/hppa/gen/__setjmp14.S
diff -u src/lib/libc/arch/hppa/gen/__setjmp14.S:1.5 src/lib/libc/arch/hppa/gen/__setjmp14.S:1.6
--- src/lib/libc/arch/hppa/gen/__setjmp14.S:1.5	Mon Apr 28 20:22:55 2008
+++ src/lib/libc/arch/hppa/gen/__setjmp14.S	Sat Jul 16 09:51:13 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: __setjmp14.S,v 1.5 2008/04/28 20:22:55 martin Exp $	*/
+/*	$NetBSD: __setjmp14.S,v 1.6 2016/07/16 09:51:13 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __setjmp14.S,v 1.5 2008/04/28 20:22:55 martin Exp $")
+	RCSID("$NetBSD: __setjmp14.S,v 1.6 2016/07/16 09:51:13 skrll Exp $")
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -66,7 +66,6 @@ ENTRY(__setjmp14,0)
 	stw	%r1, 28(%arg0)		; sc.sc_pcsqh = %sr0
 	ldo	4(%rp), %r1
 	stw	%r1, 32(%arg0)		; sc.sc_pcoqt = %rp + 4
-#define PSW_MBS (PSW_C|PSW_Q|PSW_P|PSW_D|PSW_I)
 	ldil	L%PSW_MBS, %r1
 	ldo	R%PSW_MBS(%r1), %r1
 	stw	%r1, 36(%arg0)		; set sc.sc_ps



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

2016-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 19 21:27:38 UTC 2016

Modified Files:
src/lib/libc/arch/x86_64/sys: ptrace.S

Log Message:
Save and restore all the registers we need instead of playing tricks and
"knowing" which registers the compiler clobbers. gcc-5.3 clobbers both
rcx and rdx...


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/x86_64/sys/ptrace.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/x86_64/sys/ptrace.S
diff -u src/lib/libc/arch/x86_64/sys/ptrace.S:1.6 src/lib/libc/arch/x86_64/sys/ptrace.S:1.7
--- src/lib/libc/arch/x86_64/sys/ptrace.S:1.6	Mon Nov 24 10:33:18 2014
+++ src/lib/libc/arch/x86_64/sys/ptrace.S	Sat Mar 19 17:27:38 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.S,v 1.6 2014/11/24 15:33:18 christos Exp $	*/
+/*	$NetBSD: ptrace.S,v 1.7 2016/03/19 21:27:38 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: ptrace.S,v 1.6 2014/11/24 15:33:18 christos Exp $")
+	RCSID("$NetBSD: ptrace.S,v 1.7 2016/03/19 21:27:38 christos Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 #include "SYS.h"
@@ -46,19 +46,21 @@
 ENTRY(ptrace)
 	/*
 	 * The following code calls __errno() to set it to 0 before
-	 * calling ptrace(2). The libc version of __errno() does not use
-	 * any registers, but the libpthread version clobbers %rcx
-	 * before we get a chance to store it in %r10. So we save it
-	 * in %r10 and restore it.
+	 * calling ptrace(2). Preserve and restore all the parameters
 	 */
-	movq	%rcx, %r10
+	pushq	%rdi
+	pushq	%rsi
+	pushq	%rdx
+	pushq	%rcx
 #ifdef __PIC__
 	call	PIC_PLT(_C_LABEL(__errno))
 #else
 	call	_C_LABEL(__errno)
 #endif /* __PIC__ */
-	movl	$0,(%rax)
-	movq	%r10, %rcx
+	popq	%rcx
+	popq	%rdx
+	popq	%rsi
+	popq	%rdi
 	SYSTRAP(ptrace)
 	jc	err
 	ret



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

2016-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jan 25 16:44:42 UTC 2016

Modified Files:
src/lib/libc/arch/hppa/gen: __longjmp14.c

Log Message:
use __register_t


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/hppa/gen/__longjmp14.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/hppa/gen/__longjmp14.c
diff -u src/lib/libc/arch/hppa/gen/__longjmp14.c:1.5 src/lib/libc/arch/hppa/gen/__longjmp14.c:1.6
--- src/lib/libc/arch/hppa/gen/__longjmp14.c:1.5	Thu Mar 22 08:31:32 2012
+++ src/lib/libc/arch/hppa/gen/__longjmp14.c	Mon Jan 25 11:44:42 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: __longjmp14.c,v 1.5 2012/03/22 12:31:32 skrll Exp $	*/
+/*	$NetBSD: __longjmp14.c,v 1.6 2016/01/25 16:44:42 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -50,8 +50,8 @@ __longjmp14(jmp_buf env, int val)
 {
 	ucontext_t uc;
 	struct sigcontext *sc = (void *)env;
-	register_t *regs = (void *)(sc + 1);
-	register register_t dp __asm("r27");
+	__register_t *regs = (void *)(sc + 1);
+	register __register_t dp __asm("r27");
 
 	/* Ensure non-zero SP */
 	if (sc->sc_sp == 0)



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

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 22:02:48 UTC 2016

Modified Files:
src/lib/libc/arch/vax/gen: __longjmp14.c

Log Message:
use __register_t


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/vax/gen/__longjmp14.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/vax/gen/__longjmp14.c
diff -u src/lib/libc/arch/vax/gen/__longjmp14.c:1.4 src/lib/libc/arch/vax/gen/__longjmp14.c:1.5
--- src/lib/libc/arch/vax/gen/__longjmp14.c:1.4	Mon Apr 28 16:22:57 2008
+++ src/lib/libc/arch/vax/gen/__longjmp14.c	Sun Jan 24 17:02:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: __longjmp14.c,v 1.4 2008/04/28 20:22:57 martin Exp $	*/
+/*	$NetBSD: __longjmp14.c,v 1.5 2016/01/24 22:02:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 
 struct _jmp_buf {
 	struct sigcontext jb_sc;
-	register_t jb_regs[6];
+	__register_t jb_regs[6];
 };
 
 void



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

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 16:01:56 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: Makefile.inc

Log Message:
cache stuff needs _KERNTYPES


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/arch/mips/gen/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/mips/gen/Makefile.inc
diff -u src/lib/libc/arch/mips/gen/Makefile.inc:1.33 src/lib/libc/arch/mips/gen/Makefile.inc:1.34
--- src/lib/libc/arch/mips/gen/Makefile.inc:1.33	Tue Mar 15 03:40:18 2011
+++ src/lib/libc/arch/mips/gen/Makefile.inc	Sun Jan 24 11:01:56 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.33 2011/03/15 07:40:18 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.34 2016/01/24 16:01:56 christos Exp $
 
 .if ${MKSOFTFLOAT} == "no"
 SRCS+=	fabs.S ldexp.S modf.S
@@ -33,6 +33,7 @@ SRCS+=	makecontext.c resumecontext.c _re
 SRCS+=	cacheflush.c
 
 CPPFLAGS._lwp.c	+= -D_LIBC_SOURCE
+CPPFLAGS.cacheflush.c	+= -D_KERNTYPES
 
 LSRCS.mips.gen=	Lint__setjmp.c Lint_bswap16.c Lint_bswap32.c Lint_swapcontext.c
 LSRCS+=		${LSRCS.mips.gen}



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

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 16:01:43 UTC 2016

Modified Files:
src/lib/libc/arch/mips/gen: longjmp.c

Log Message:
Use namespace protected types.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/gen/longjmp.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/mips/gen/longjmp.c
diff -u src/lib/libc/arch/mips/gen/longjmp.c:1.5 src/lib/libc/arch/mips/gen/longjmp.c:1.6
--- src/lib/libc/arch/mips/gen/longjmp.c:1.5	Thu Mar 29 15:27:05 2012
+++ src/lib/libc/arch/mips/gen/longjmp.c	Sun Jan 24 11:01:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: longjmp.c,v 1.5 2012/03/29 19:27:05 christos Exp $	*/
+/*	$NetBSD: longjmp.c,v 1.6 2016/01/24 16:01:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@ __longjmp14(jmp_buf env, int val)
 	ucontext_t uc;
 
 	/* Ensure non-zero SP and sigcontext magic number is present */
-	if (sc->sc_regs[_R_SP] == 0 || sc->sc_regs[_R_ZERO] != (mips_reg_t)0xACEDBADEU)
+	if (sc->sc_regs[_R_SP] == 0 || sc->sc_regs[_R_ZERO] != (__register_t)0xACEDBADEU)
 		goto err;
 
 	/* Ensure non-zero return value */



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

2016-01-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 24 15:55:34 UTC 2016

Modified Files:
src/lib/libc/arch/mips: Makefile.inc

Log Message:
assym.h needs _KERNTYPES


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/mips/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/mips/Makefile.inc
diff -u src/lib/libc/arch/mips/Makefile.inc:1.13 src/lib/libc/arch/mips/Makefile.inc:1.14
--- src/lib/libc/arch/mips/Makefile.inc:1.13	Thu Jan 30 10:05:49 2014
+++ src/lib/libc/arch/mips/Makefile.inc	Sun Jan 24 10:55:34 2016
@@ -1,16 +1,17 @@
-#	$NetBSD: Makefile.inc,v 1.13 2014/01/30 15:05:49 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2016/01/24 15:55:34 christos Exp $
 
 .include 
 
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
 
 CPPFLAGS+= -I.
-CPPFLAGS.assym.h+=-D__LIBC12_SOURCE__
+CPPFLAGS.assym.h+=-D__LIBC12_SOURCE__ -D_KERNTYPES
 
 .if ${MKSOFTFLOAT} != "no"
 .include 
 CPPFLAGS+= -DSOFTFLOAT
 
+
 SRCS+=	fixunsgen_ieee754.c
 SRCS+=	fixunsgen64_ieee754.c #fixunssfdi.c fixunsdfdi.c
 .if (${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el") \



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

2015-08-20 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Aug 20 16:13:41 UTC 2015

Modified Files:
src/lib/libc/arch/arm: Makefile.inc

Log Message:
In rumprun mode on ARM, don't build syscall or signal code into libc.
(like on x86)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/arch/arm/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/arm/Makefile.inc
diff -u src/lib/libc/arch/arm/Makefile.inc:1.27 src/lib/libc/arch/arm/Makefile.inc:1.28
--- src/lib/libc/arch/arm/Makefile.inc:1.27	Wed Jan 29 23:37:18 2014
+++ src/lib/libc/arch/arm/Makefile.inc	Thu Aug 20 16:13:40 2015
@@ -1,8 +1,10 @@
-# $NetBSD: Makefile.inc,v 1.27 2014/01/29 23:37:18 joerg Exp $
+# $NetBSD: Makefile.inc,v 1.28 2015/08/20 16:13:40 pooka Exp $
 
 .include 
 
+.if ${RUMPRUN} != "yes"
 SRCS+=	__aeabi_read_tp.S __sigaction14_sigtramp.c __sigtramp2.S
+.endif
 
 .if empty(LIBC_MACHINE_ARCH:Mearmv7*)
 AFLAGS+= -marm



CVS commit: src/lib/libc/arch

2015-07-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 15 14:23:40 UTC 2015

Modified Files:
src/lib/libc/arch/i386/gen: Makefile.inc
src/lib/libc/arch/x86_64/gen: Makefile.inc

Log Message:
Remove "objects built from C sources" comments.  Everyone can see
they're built from C sources because the source files end in .c (???)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/arch/i386/gen/Makefile.inc
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/arch/x86_64/gen/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/i386/gen/Makefile.inc
diff -u src/lib/libc/arch/i386/gen/Makefile.inc:1.27 src/lib/libc/arch/i386/gen/Makefile.inc:1.28
--- src/lib/libc/arch/i386/gen/Makefile.inc:1.27	Sat Mar 26 19:51:41 2011
+++ src/lib/libc/arch/i386/gen/Makefile.inc	Wed Jul 15 14:23:40 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.27 2011/03/26 19:51:41 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.28 2015/07/15 14:23:40 pooka Exp $
 
 # objects built from assembler sources (need lint stubs)
 SRCS+=	alloca.S byte_swap_2.S byte_swap_4.S fabs.S \
@@ -9,8 +9,6 @@ SRCS+=	alloca.S byte_swap_2.S byte_swap_
 SRCS+=	setjmp.S _setjmp.S sigsetjmp.S
 
 SRCS+=	resumecontext.S swapcontext.S
-
-# objects built from C sources
 SRCS+=	bswap64.c _lwp.c makecontext.c
 
 # Common ieee754 constants and functions

Index: src/lib/libc/arch/x86_64/gen/Makefile.inc
diff -u src/lib/libc/arch/x86_64/gen/Makefile.inc:1.16 src/lib/libc/arch/x86_64/gen/Makefile.inc:1.17
--- src/lib/libc/arch/x86_64/gen/Makefile.inc:1.16	Sat Mar 26 19:51:42 2011
+++ src/lib/libc/arch/x86_64/gen/Makefile.inc	Wed Jul 15 14:23:40 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.16 2011/03/26 19:51:42 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.17 2015/07/15 14:23:40 pooka Exp $
 
 # objects built from assembler sources (need lint stubs)
 SRCS+=	alloca.S byte_swap_2.S byte_swap_4.S byte_swap_8.S fabs.S \
@@ -11,8 +11,6 @@ SRCS+=	_setjmp.S
 SRCS+=	__sigsetjmp14.S
 
 SRCS+=	resumecontext.S swapcontext.S
-
-# objects built from C sources
 SRCS+=	_lwp.c makecontext.c
 
 # Common ieee754 constants and functions



CVS commit: src/lib/libc/arch

2015-07-15 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Wed Jul 15 14:27:49 UTC 2015

Modified Files:
src/lib/libc/arch/i386: Makefile.inc
src/lib/libc/arch/i386/gen: Makefile.inc
src/lib/libc/arch/x86_64: Makefile.inc
src/lib/libc/arch/x86_64/gen: Makefile.inc

Log Message:
Don't include sigtramp or foocontext routines in rumprun mode.  They won't
work (since a rump kernel does not provide NetBSD _lwp syscalls nor
signals), but they cause unwanted symbols to be pulled in when the
resulting libc is linked.

problem reported by Robert Gifford on rumpkernel-users


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/arch/i386/Makefile.inc
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/arch/i386/gen/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/x86_64/Makefile.inc
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/arch/x86_64/gen/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/i386/Makefile.inc
diff -u src/lib/libc/arch/i386/Makefile.inc:1.20 src/lib/libc/arch/i386/Makefile.inc:1.21
--- src/lib/libc/arch/i386/Makefile.inc:1.20	Sat Jun 17 18:04:23 2006
+++ src/lib/libc/arch/i386/Makefile.inc	Wed Jul 15 14:27:49 2015
@@ -1,3 +1,5 @@
-#	$NetBSD: Makefile.inc,v 1.20 2006/06/17 18:04:23 uwe Exp $
+#	$NetBSD: Makefile.inc,v 1.21 2015/07/15 14:27:49 pooka Exp $
 
+.if ${RUMPRUN} != "yes"
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
+.endif

Index: src/lib/libc/arch/i386/gen/Makefile.inc
diff -u src/lib/libc/arch/i386/gen/Makefile.inc:1.28 src/lib/libc/arch/i386/gen/Makefile.inc:1.29
--- src/lib/libc/arch/i386/gen/Makefile.inc:1.28	Wed Jul 15 14:23:40 2015
+++ src/lib/libc/arch/i386/gen/Makefile.inc	Wed Jul 15 14:27:49 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.28 2015/07/15 14:23:40 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.29 2015/07/15 14:27:49 pooka Exp $
 
 # objects built from assembler sources (need lint stubs)
 SRCS+=	alloca.S byte_swap_2.S byte_swap_4.S fabs.S \
@@ -8,8 +8,12 @@ SRCS+=	alloca.S byte_swap_2.S byte_swap_
 
 SRCS+=	setjmp.S _setjmp.S sigsetjmp.S
 
+.if ${RUMPRUN} != "yes"
 SRCS+=	resumecontext.S swapcontext.S
-SRCS+=	bswap64.c _lwp.c makecontext.c
+SRCS+=	_lwp.c makecontext.c
+.endif
+
+SRCS+=	bswap64.c
 
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c

Index: src/lib/libc/arch/x86_64/Makefile.inc
diff -u src/lib/libc/arch/x86_64/Makefile.inc:1.5 src/lib/libc/arch/x86_64/Makefile.inc:1.6
--- src/lib/libc/arch/x86_64/Makefile.inc:1.5	Sat Jun 17 18:04:24 2006
+++ src/lib/libc/arch/x86_64/Makefile.inc	Wed Jul 15 14:27:49 2015
@@ -1,3 +1,5 @@
-#	$NetBSD: Makefile.inc,v 1.5 2006/06/17 18:04:24 uwe Exp $
+#	$NetBSD: Makefile.inc,v 1.6 2015/07/15 14:27:49 pooka Exp $
 
+.if ${RUMPRUN} != "yes"
 SRCS+=	__sigaction14_sigtramp.c __sigtramp2.S
+.endif

Index: src/lib/libc/arch/x86_64/gen/Makefile.inc
diff -u src/lib/libc/arch/x86_64/gen/Makefile.inc:1.17 src/lib/libc/arch/x86_64/gen/Makefile.inc:1.18
--- src/lib/libc/arch/x86_64/gen/Makefile.inc:1.17	Wed Jul 15 14:23:40 2015
+++ src/lib/libc/arch/x86_64/gen/Makefile.inc	Wed Jul 15 14:27:49 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.17 2015/07/15 14:23:40 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.18 2015/07/15 14:27:49 pooka Exp $
 
 # objects built from assembler sources (need lint stubs)
 SRCS+=	alloca.S byte_swap_2.S byte_swap_4.S byte_swap_8.S fabs.S \
@@ -10,8 +10,10 @@ SRCS+=	__setjmp14.S
 SRCS+=	_setjmp.S
 SRCS+=	__sigsetjmp14.S
 
+.if ${RUMPRUN} != "yes"
 SRCS+=	resumecontext.S swapcontext.S
 SRCS+=	_lwp.c makecontext.c
+.endif
 
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c



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

2015-07-07 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Jul  7 21:40:19 UTC 2015

Modified Files:
src/lib/libc/arch/aarch64/gen: Makefile.inc
Added Files:
src/lib/libc/arch/aarch64/gen: fpsetmask.c fpsetround.c fpsetsticky.c

Log Message:
Add the fpset* routines for tests


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/aarch64/gen/fpsetmask.c \
src/lib/libc/arch/aarch64/gen/fpsetround.c \
src/lib/libc/arch/aarch64/gen/fpsetsticky.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/aarch64/gen/Makefile.inc
diff -u src/lib/libc/arch/aarch64/gen/Makefile.inc:1.1 src/lib/libc/arch/aarch64/gen/Makefile.inc:1.2
--- src/lib/libc/arch/aarch64/gen/Makefile.inc:1.1	Sun Aug 10 05:47:36 2014
+++ src/lib/libc/arch/aarch64/gen/Makefile.inc	Tue Jul  7 21:40:19 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.1 2014/08/10 05:47:36 matt Exp $
+# $NetBSD: Makefile.inc,v 1.2 2015/07/07 21:40:19 matt Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S byte_swap_8.S
 SRCS+=	flt_rounds.c
@@ -6,6 +6,8 @@ SRCS+=	flt_rounds.c
 # Common ieee754 constants and functions
 SRCS+=	infinityf_ieee754.c infinity_ieee754.c infinityl_ieee754.c
 SRCS+=	fpclassifyf_ieee754.c fpclassifyd_ieee754.c fpclassifyl_ieee754.c
+SRCS+=	fpgetmask.c fpgetround.c fpgetsticky.c
+SRCS+=	fpsetmask.c fpsetround.c fpsetsticky.c
 SRCS+=	isfinitef_ieee754.c isfinited_ieee754.c isfinitel_ieee754.c
 SRCS+=	isinff_ieee754.c isinfd_ieee754.c isinfl_ieee754.c
 SRCS+=	isnanf_ieee754.c isnand_ieee754.c isnanl_ieee754.c

Added files:

Index: src/lib/libc/arch/aarch64/gen/fpsetmask.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.1
--- /dev/null	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetmask.c	Tue Jul  7 21:40:19 2015
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 
+
+__RCSID("$NetBSD: fpsetmask.c,v 1.1 2015/07/07 21:40:19 matt Exp $");
+
+#include 
+#include 
+#include 
+
+#include "namespace.h"
+
+#include 
+
+#include 
+
+__weak_alias(fpsetmask,_fpsetmask);
+
+fp_except_t
+fpsetmask(fp_except_t mask)
+{
+	const uint32_t old_fpcr = reg_fpcr_read();
+	const uint32_t new_fpcr = (old_fpcr & ~FPCR_ESUM)
+	| __SHIFTIN(mask, FPCR_ESUM);
+	reg_fpcr_write(new_fpcr);
+	return __SHIFTOUT(old_fpcr, FPCR_ESUM);
+}
Index: src/lib/libc/arch/aarch64/gen/fpsetround.c
diff -u /dev/null src/lib/libc/arch/aarch64/gen/fpsetround.c:1.1
--- /dev/null	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/fpsetround.c	Tue Jul  7 21:40:19 2015
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 2015 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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. 

  1   2   3   4   >