From patchwork Thu Apr 11 12:32:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Fedotov X-Patchwork-Id: 162057 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7363826jan; Thu, 11 Apr 2019 05:33:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP5cuwA1ieNicOKu7dNXl9fYuMohRqm12LZe6SIclp5IMGRl9qCnJVi0y4aynPnowI0pjP X-Received: by 2002:a63:6fc1:: with SMTP id k184mr45840361pgc.239.1554985997436; Thu, 11 Apr 2019 05:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554985997; cv=none; d=google.com; s=arc-20160816; b=Ida7fPQLCkChtT8Q+tbKXLaZfD4WRT1iIup2Y6wZbMRTIbspdVa7hFyLrGc/7buR9k hgUvLpMpGuCSpsFVfWIm4j9+vVdkgyZeWkv+c9Ok2WAPsSNk43IMWBl8GLNjEbyb/Ho9 V6k9tx6chRJSbbjCwu3xUrz4/7X/BaTBIFg4sSd6nqUZdQ/uS4ymU5pZ5/NdI9AGsQ40 QEV9U7vn5J9YnhZXmj4rJoPfnmnxLt/xtIb0Hq7zK33aJeURkML0P3e2R37JYHWB4i5D axlq3bOaCyonx/wbcTOpvyWJuROQUgl0rtL5bQ49iHOdE8NIEERJXKbxaGQEqn50LB0Y izdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=zfWa0o8/qhwx5Jscf8mQyGIA/lh7AOu0cYQiFdTvBko=; b=W/k9V90fj/Ox6IncwwhGIabSObpyH5Hc63TaNxNPEUVUbraUTM+ve26LMy6MVfZm4r 2+axaEBXqmWuNAW2TMHjWD6Y30e7TpW7/HPdjoS70an4FgUVnWyR2Ibm+dIecDEeceDl /kVc8tuvK4Ll6d7BA0t8VgavNLLpVwd+SyaMr6jaTahLlKmEvsqOShG2UFhwGm/23PMr zo2NkKmAyh7RMCkKgKRHI/zehHlF+YX4SzpNEPoksDQmu7aD87gyEwu9dYwpPsH//4eV tJXWyX2qEy9gUO9AmyfJ33eZnF/m/CTcOIAhCrD3AWXN3h/fp/Y3dPJZUDl9CUmNSTpD buWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=bvEhv22j; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Qmvj/EtC"; spf=pass (google.com: domain of newlib-return-16865-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16865-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u125si32933703pfb.112.2019.04.11.05.33.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 05:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-16865-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=bvEhv22j; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Qmvj/EtC"; spf=pass (google.com: domain of newlib-return-16865-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="newlib-return-16865-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=Xw6Vq2pXi+yvdvbtHEjPkxb5Uilwc KrO8hTiAbBzmhCjy/Rkf2hqFb7wCOu4cNB8jFpWEt+9zSM31RbzygJy1lSpnmigB 3jEOxzphDY4aOzUIjo1cYCOYOHvD6LofyhN825jvvAjadokcYunGrEMMbdMNhTFG A8lovNLauCoiKM= 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:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=jC/diq7974MWYgAVCx+9AJK9ggo=; b=bvE hv22jclvnMpmAOoW+/5uHp7IIHr8RMySHrWOmLz/bWnWN49OO53mmR6k4ds7zg+2 NQp0AfU8KY7lk4P0deTusDRMREXqwmAWORfuEQ1XrchZpeil+EqvvOwlyzyZlztP mYEStn+Zz+YCqd5KjnAxFZBmKRJjLNGtGXDhp64o= Received: (qmail 130902 invoked by alias); 11 Apr 2019 12:33:08 -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 130890 invoked by uid 89); 11 Apr 2019 12:33:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sp, Null, highest, adr X-HELO: mail-it1-f180.google.com Received: from mail-it1-f180.google.com (HELO mail-it1-f180.google.com) (209.85.166.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Apr 2019 12:33:05 +0000 Received: by mail-it1-f180.google.com with SMTP id y134so9227811itc.5 for ; Thu, 11 Apr 2019 05:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=zfWa0o8/qhwx5Jscf8mQyGIA/lh7AOu0cYQiFdTvBko=; b=Qmvj/EtC+yn/CdiMNe2iU72xsFTccM0bptJOc2qyouACtyfrGx+NhHTaQuXDeqPd3Z arVZg5qKcrBylEejc42EqpiBAWlXEDg0rVizcvelVpEEQjwkC9P3uj2G/yUZ80mtK/DQ 1mFKfKO8RChxJLa/n6TQXzhQoLS33gcDcFBm20QFMdqQZQGs2F8AlRhWPrHM34ru1o7C +aS6raErF2XCGiXO9/jo4WLBoehnj0QnZJ9TvIzEoQDwyD/xjlnHf2HDxzMd9IjiOYVB 28/DatAbSQhBwMVkBdL9sJr+wuz+1eQYcid0Sz/DNEhSPrK4IPYoQ/e2s+4UkK2dyerD Nyxg== MIME-Version: 1.0 From: Alexander Fedotov Date: Thu, 11 Apr 2019 15:32:53 +0300 Message-ID: Subject: [Arm] Align comments and spaces in crt0.S libgloss and sys/arm To: "Richard Earnshaw (lists)" , Newlib >From 2f38517a1b7760f59cfdc37aa2e7220488b04805 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Thu, 11 Apr 2019 15:28:05 +0300 Subject: [PATCH] Align comments and spaces in libgloss/arm/crt0.S and newlib/libc/sys/arm/crt0.S to ease further code alignment. --- libgloss/arm/crt0.S | 94 ++++++++++++++++++-------------------- newlib/libc/sys/arm/crt0.S | 4 +- 2 files changed, 47 insertions(+), 51 deletions(-) -- 2.20.1.windows.1 diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S index c708f63d8..6ed923352 100644 --- a/libgloss/arm/crt0.S +++ b/libgloss/arm/crt0.S @@ -90,14 +90,14 @@ #endif #endif -/* Start by setting up a stack */ +/* Start by setting up a stack. */ #ifdef ARM_RDP_MONITOR - /* Issue Demon SWI to read stack info */ - swi SWI_GetEnv /* Returns command line in r0 */ - mov sp,r1 /* and the highest memory address in r1 */ + /* Issue Demon SWI to read stack info. */ + swi SWI_GetEnv /* Returns command line in r0. */ + mov sp,r1 /* and the highest memory address in r1. */ - /* stack limit is at end of data */ - /* allow slop for stack overflow handling and small frames */ + /* Stack limit is at end of data. */ + /* Allow slop for stack overflow handling and small frames. */ #ifdef THUMB1_ONLY ldr r0, .LC2 adds r0, #128 @@ -109,19 +109,19 @@ #endif #else #ifdef ARM_RDI_MONITOR - /* Issue Angel SWI to read stack info */ + /* Issue Angel SWI to read stack info. */ movs r0, #AngelSWI_Reason_HeapInfo - adr r1, .LC0 /* point at ptr to 4 words to receive data */ + adr r1, .LC0 /* Point at ptr to 4 words to receive data. */ #ifdef THUMB_VXM bkpt AngelSWI #elif defined(__thumb2__) - /* We are in thumb mode for startup on armv7 architectures. */ + /* We are in thumb mode for startup on armv7 architectures. */ AngelSWIAsm (AngelSWI) #else - /* We are always in ARM mode for startup on pre armv7 archs. */ + /* We are always in ARM mode for startup on pre armv7 archs. */ AngelSWIAsm (AngelSWI_ARM) #endif - ldr r0, .LC0 /* point at values read */ + ldr r0, .LC0 /* Point at values read. */ /* Set __heap_limit. */ ldr r1, [r0, #4] @@ -192,7 +192,7 @@ /* Note: This 'mov' is essential when starting in User, and ensures we always get *some* sp value for the initial mode, even if we have somehow missed it below (in which case it gets the same - value as FIQ - not ideal, but better than nothing.) */ + value as FIQ - not ideal, but better than nothing). */ mov sp, r3 #ifdef PREFER_THUMB /* XXX Fill in stack assignments for interrupt modes. */ @@ -248,19 +248,19 @@ #endif #endif /* Zero the memory in the .bss section. */ - movs a2, #0 /* Second arg: fill value */ - mov fp, a2 /* Null frame pointer */ - mov r7, a2 /* Null frame pointer for Thumb */ + movs a2, #0 /* Second arg: fill value. */ + mov fp, a2 /* Null frame pointer. */ + mov r7, a2 /* Null frame pointer for Thumb. */ - ldr a1, .LC1 /* First arg: start of memory block */ + ldr a1, .LC1 /* First arg: start of memory block. */ ldr a3, .LC2 - subs a3, a3, a1 /* Third arg: length of block */ + subs a3, a3, a1 /* Third arg: length of block. */ #if __thumb__ && !defined(PREFER_THUMB) - /* Enter Thumb mode.... */ - add a4, pc, #1 /* Get the address of the Thumb block */ - bx a4 /* Go there and start Thumb decoding */ + /* Enter Thumb mode... */ + add a4, pc, #1 /* Get the address of the Thumb block. */ + bx a4 /* Go there and start Thumb decoding. */ .code 16 .global __change_mode @@ -271,9 +271,8 @@ __change_mode: bl FUNCTION (memset) #if !defined (ARM_RDP_MONITOR) && !defined (ARM_RDI_MONITOR) /* Changes by toralf: Taken from libgloss/m68k/crt0.S - * initialize target specific stuff. Only execute these - * functions it they exist. - */ + initialize target specific stuff. Only execute these + functions it they exist. */ ldr r3, .Lhwinit cmp r3, #0 beq .LC24 @@ -285,24 +284,24 @@ __change_mode: indirect_call r3 .LC25: - movs r0, #0 /* no arguments */ - movs r1, #0 /* no argv either */ + movs r0, #0 /* No arguments. */ + movs r1, #0 /* No argv either. */ #else - /* Need to set up standard file handles */ + /* Need to set up standard file handles. */ bl FUNCTION (initialise_monitor_handles) #ifdef ARM_RDP_MONITOR - swi SWI_GetEnv /* sets r0 to point to the command line */ + swi SWI_GetEnv /* Sets r0 to point to the command line. */ movs r1, r0 #else movs r0, #AngelSWI_Reason_GetCmdLine - ldr r1, .LC30 /* Space for command line */ + ldr r1, .LC30 /* Space for command line. */ AngelSWIAsm (AngelSWI) ldr r1, .LC30 ldr r1, [r1] #endif - /* Parse string at r1 */ - movs r0, #0 /* count of arguments so far */ + /* Parse string at r1. */ + movs r0, #0 /* Count of arguments so far. */ /* Push a NULL argument onto the end of the list. */ #ifdef __thumb__ push {r0} @@ -310,7 +309,7 @@ __change_mode: stmfd sp!, {r0} #endif .LC10: -/* Skip leading blanks */ +/* Skip leading blanks. */ #ifdef __thumb__ ldrb r3, [r1] adds r1, #1 @@ -322,7 +321,7 @@ __change_mode: cmp r3, #' ' beq .LC10 -/* See whether we are scanning a string */ +/* See whether we are scanning a string. */ cmp r3, #'"' #ifdef __thumb__ beq .LC20 @@ -333,17 +332,17 @@ __change_mode: b .LC22 .LC21: - movs r2, #' ' /* terminator type */ - subs r1, r1, #1 /* adjust back to point at start char */ + movs r2, #' ' /* Terminator type. */ + subs r1, r1, #1 /* Adjust back to point at start char. */ .LC22: #else cmpne r3, #'\'' moveq r2, r3 - movne r2, #' ' /* terminator type */ - subne r1, r1, #1 /* adjust back to point at start char */ + movne r2, #' ' /* Terminator type. */ + subne r1, r1, #1 /* Adjust back to point at start char. */ #endif -/* Stack a pointer to the current argument */ +/* Stack a pointer to the current argument. */ #ifdef __thumb__ push {r1} #else @@ -359,16 +358,16 @@ __change_mode: #endif cmp r3, #0 beq .LC12 - cmp r2, r3 /* reached terminator? */ + cmp r2, r3 /* Reached terminator ? */ bne .LC11 movs r2, #0 subs r3, r1, #1 - strb r2, [r3] /* terminate the arg string */ + strb r2, [r3] /* Terminate the arg string. */ b .LC10 .LC12: - mov r1, sp /* point at stacked arg pointers */ - /* We've now got the stacked args in order reverse the */ + mov r1, sp /* Point at stacked arg pointers. */ + /* We've now got the stacked args in order, reverse them. */ #ifdef __thumb__ movs r2, r0 lsls r2, #2 @@ -390,10 +389,10 @@ __change_mode: bics r4, r5 mov sp, r4 #else - add r2, sp, r0, LSL #2 /* End of args */ - mov r3, sp /* Start of args */ + add r2, sp, r0, LSL #2 /* End of args. */ + mov r3, sp /* Start of args. */ .LC13: cmp r2, r3 - ldrhi r4,[r2, #-4] /* Reverse ends of list */ + ldrhi r4,[r2, #-4] /* Reverse ends of list. */ ldrhi r5, [r3] strhi r5, [r2, #-4]! strhi r4, [r3], #4 @@ -431,7 +430,6 @@ __change_mode: #if __thumb__ && !defined(PREFER_THUMB) /* Come out of Thumb mode. This code should be redundant. */ - mov a4, pc bx a4 @@ -447,7 +445,6 @@ change_back: /* For Thumb, constants must be after the code since only positive offsets are supported for PC relative addresses. */ - .align 0 .LC0: #ifdef ARM_RDI_MONITOR @@ -457,8 +454,7 @@ change_back: /* Changes by toralf: Provide alternative "stack" variable whose value may be defined externally; .Lstack will be used instead of .LC0 if it points to a non-0 value. Also set up references to "hooks" that - may be used by the application to provide additional init code. */ - + may be used by the application to provide additional init code. */ #ifdef __pe__ .word 0x800000 #else @@ -476,7 +472,7 @@ change_back: runtime (meaning "ignore setting") for the variables, when the user does not provide the symbols. (The linker uses a weak symbol if, and only if, a normal version of the same symbol isn't provided - e.g. by a linker script or another object file.) */ + e.g. by a linker script or another object file). */ .weak __stack .weak FUNCTION (hardware_init_hook) diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S index 64d425900..3db123d1e 100644 --- a/newlib/libc/sys/arm/crt0.S +++ b/newlib/libc/sys/arm/crt0.S @@ -399,7 +399,7 @@ __change_mode: bl FUNCTION (_init) movs r0, r4 movs r1, r5 -#endif +#endif bl FUNCTION (main) bl FUNCTION (exit) /* Should not return. */ @@ -420,7 +420,7 @@ change_back: #endif /* For Thumb, constants must be after the code since only - positive offsets are supported for PC relative addresses. */ + positive offsets are supported for PC relative addresses. */ .align 0 .LC0: #ifdef ARM_RDI_MONITOR