public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] arm: Finish moving newlib to unified syntax for Thumb1
Date: Mon, 02 Mar 2020 13:39:00 -0000	[thread overview]
Message-ID: <20200302133951.15525.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f973a7d8bea03ad840bdcbc7eae032516e75174b

commit f973a7d8bea03ad840bdcbc7eae032516e75174b
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Mon Mar 2 13:33:11 2020 +0000

    arm: Finish moving newlib to unified syntax for Thumb1
    
    Most code in newlib already uses unified syntax, but just a couple of
    laggards remain.  This patch removes these and means the the entire
    code base has now been converted.

Diff:
---
 libgloss/arm/linux-syscalls0.S   | 11 +++++++++++
 newlib/libc/machine/arm/setjmp.S | 15 ++++++++-------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/libgloss/arm/linux-syscalls0.S b/libgloss/arm/linux-syscalls0.S
index b16648f..17d246e 100644
--- a/libgloss/arm/linux-syscalls0.S
+++ b/libgloss/arm/linux-syscalls0.S
@@ -6,6 +6,8 @@
  * is freely granted, provided that this notice is preserved.
  */
 
+	.syntax unified
+
 #include "linux-syscall.h"
 
 #if __thumb__
@@ -146,12 +148,21 @@ ALIAS(utime)
 ALIAS(vfork)
 ALIAS(wait4)
 
+#if defined (__thumb__) && !defined (__thumb2__)
+# define SOCKETCALL(name, NAME) \
+	GLOBAL(name); \
+	push { r0 - r3 }; \
+	movs r0, #SYS_ ## NAME; \
+	b _socketcall_tail; \
+	SIZE(name)
+#else
 # define SOCKETCALL(name, NAME) \
 	GLOBAL(name); \
 	push { r0 - r3 }; \
 	mov r0, #SYS_ ## NAME; \
 	b _socketcall_tail; \
 	SIZE(name)
+#endif
 
 FUNC(_socketcall_tail)
 	mov r1, sp
diff --git a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S
index 1ba711d..21d6ff9 100644
--- a/newlib/libc/machine/arm/setjmp.S
+++ b/newlib/libc/machine/arm/setjmp.S
@@ -57,6 +57,8 @@
    
    For Thumb-2 do everything in Thumb mode.  */
 
+	.syntax unified
+
 #if __ARM_ARCH_ISA_THUMB == 1 && !__ARM_ARCH_ISA_ARM
 /* ARMv6-M-like has to be implemented in Thumb mode.  */
 
@@ -74,11 +76,11 @@ SYM (setjmp):
 	mov	r5, sp
 	mov	r6, lr
 	stmia	r0!, {r1, r2, r3, r4, r5, r6}
-	sub	r0, r0, #40
+	subs	r0, r0, #40
 	/* Restore callee-saved low regs.  */
 	ldmia	r0!, {r4, r5, r6, r7}
 	/* Return zero.  */
-	mov	r0, #0
+	movs	r0, #0
 	bx lr
 
 .thumb_func
@@ -86,7 +88,7 @@ SYM (setjmp):
 	TYPE (longjmp)
 SYM (longjmp):
 	/* Restore High regs.  */
-	add	r0, r0, #16
+	adds	r0, r0, #16
 	ldmia	r0!, {r2, r3, r4, r5, r6}
 	mov	r8, r2
 	mov	r9, r3
@@ -95,12 +97,12 @@ SYM (longjmp):
 	mov	sp, r6
 	ldmia	r0!, {r3} /* lr */
 	/* Restore low regs.  */
-	sub	r0, r0, #40
+	subs	r0, r0, #40
 	ldmia	r0!, {r4, r5, r6, r7}
 	/* Return the result argument, or 1 if it is zero.  */
-	mov	r0, r1
+	movs	r0, r1
 	bne	1f
-	mov	r0, #1
+	movs	r0, #1
 1:
 	bx	r3
 
@@ -126,7 +128,6 @@ SYM (longjmp):
 #endif
 
 #if defined(__thumb2__)
-.syntax unified
 .macro MODE
 	.thumb
 	.thumb_func


                 reply	other threads:[~2020-03-02 13:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200302133951.15525.qmail@sourceware.org \
    --to=rearnsha@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).