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/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/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/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/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/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/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)