From patchwork Mon Mar 2 13:42:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 184090 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2421367ile; Mon, 2 Mar 2020 05:43:01 -0800 (PST) X-Google-Smtp-Source: ADFU+vsbriCv1ysfpBZ7h+NaZm435HJmUGIamc9ojMy1zHtWapvgxJ+igqeH7ewqFIZxIL3HOiCk X-Received: by 2002:aca:fd90:: with SMTP id b138mr5591610oii.73.1583156581683; Mon, 02 Mar 2020 05:43:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583156581; cv=none; d=google.com; s=arc-20160816; b=DNg9pACxa+0kpPxkF1joDeyLSAyW5dNotqTY0qKVRv6EYJO3YIYrf0j16wP59rOt7+ x7+UsW4R/y/12/b1CxohK8ZPEWFXuYclX/0XN12oW4a6BUDagIM2ByRj7T5kVq9Z5/vD aZkzQbSBYiKFkgmXc5FPewwUxYwKgAVBVT43DvbOCpsdjr4KQqoQL9ZXXlGy/+o6snD0 op35pkWJt1AJsQIEkXpW9GErHZuC4w1tk4NXuiibscXo8JWYiNKTl03vi3oN5SIGwn7t h01BTl9zwmjREcHPMApsku2w1c9qfoETfCbUx46lqyA11Tw53A6e/guLgch1C8fnMNcd ZfDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:subject:from:to :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=QvlcAyY7AAIWzl0oWc//34s1ZgKY0YE7b4+2TLGOdnE=; b=INxUBZAQWTdVgLRYTMVQZWzgKI6orb9Mf3GSCjCEb/F6TU4MNqjwccqVRZKUlb83Rw Vq856OG2jicxXAfzHVS093zeuocBks0+CZfoarIbMIoG0GQsqCPz07kLSvE9Ot6KsRYb n9IYHl3I7ST4ixW4h+UR7+E2TrpXEGM9/PMLiBH4teQE/fg4EnNu7zXW1zoQxbYVFy2V SqkUzSVPbcEQVQ0/mE3Tzp+1c2Lir5OhwI/nKPmR1ObVjVE4AS0Md7TAQaoFNIatYGML 6XqYtAANlABpYsqno3nWl0fWzyXGLl7z19R1iNDzI2sVmkk/KfQFGf7OvpE5EYrDAyAZ kSBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qAPzsxWT; spf=pass (google.com: domain of newlib-return-17502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-17502-patch=linaro.org@sourceware.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c15si1852362otr.206.2020.03.02.05.43.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2020 05:43:01 -0800 (PST) Received-SPF: pass (google.com: domain of newlib-return-17502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qAPzsxWT; spf=pass (google.com: domain of newlib-return-17502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-17502-patch=linaro.org@sourceware.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; q=dns; s=default; b=mBq3iNW6mNCnS9WSQhZTm8G1TRK4k tYEulXedY+7iL3mst7ypAk35vwTvdlWns2zRqgqdkL4c6FLjghFTpElw7VcKZfM7 x/8kejTJP6SIJj97ltHBO8cXuMkD6DFEasmxiK4my4jvkKWI3XcCTfR6m5t1hmDu FdDCcVfBBxYkl8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:message-id:date:mime-version :content-type; s=default; bh=d477EqHs9tVWJSwhLs2+cgHax1Q=; b=qAP zsxWTWQgHeEcnGl2TPlXpv2ruYvBSFT2Eq7lbLRJA0AHMbYAUeLp8GumQ+ugzdTy 0smCJi3raZwjaY88WCOwhaR9YX1HBhGs1aK0hc9436shYsRd2tC5iRzvsI8s9JBV pZjf7t+jTIC7EkoN0Xq+5LtvLF8pY3qxd+7kuu3E= Received: (qmail 53852 invoked by alias); 2 Mar 2020 13:42:53 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 53844 invoked by uid 89); 2 Mar 2020 13:42:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 13:42:52 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A32C22F; Mon, 2 Mar 2020 05:42:50 -0800 (PST) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.78.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 142CC3F534; Mon, 2 Mar 2020 05:42:49 -0800 (PST) To: newlib@sourceware.org From: "Richard Earnshaw (lists)" Subject: [committed] arm: Finish moving newlib to unified syntax for Thumb1 Message-ID: <1d6d59f1-5bec-e164-827f-2b633ca9550d@arm.com> Date: Mon, 2 Mar 2020 13:42:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 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. Committed. R. diff --git a/libgloss/arm/linux-syscalls0.S b/libgloss/arm/linux-syscalls0.S index b16648fc3..17d246e1c 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 1ba711d5e..21d6ff9e7 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