From patchwork Mon Jul 22 21:39:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 169436 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp8012303ilk; Mon, 22 Jul 2019 14:41:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrYiKeyuM4SOab1r6Pf+oNH8bCYmTS9njDPy0tpTE89k1I9NAihWEk/uwkU7K4AENHK/xG X-Received: by 2002:a6b:3102:: with SMTP id j2mr1731573ioa.5.1563831678132; Mon, 22 Jul 2019 14:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563831678; cv=none; d=google.com; s=arc-20160816; b=IgJvxwpJG4MNJKXH41H3xnls1rBC2V2iWVUmYNJrD9+LVFMSewRU7EdPJTPe29pOz4 TkZyMgiHbGiXMcE8vLEWL3V3WXSF+6a6JYK/PKLgJhLOwASeNoeLVcTGVvA+JH6TFFR5 zfda5AVFNnMNx1uEiYqZEOvNU0zjA+USuSmp3k06G7l+pO2n6AZcG2JwvK3cqx4EMqwg abQTbZYImhbMaR6vvE4aZUUdSZno+d8yvrVWpoyrA5l7IYzdKernNCd4KAbha5Jj5hum fJaHl9C7HHRbsIzHZ1Yo9CZCxkWFhePu3vnxDw+uAXwQzpUVKcJAUV78J1wVoFz3hZQj weOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=baSz94P9FUOeEHtkubYt+kYMB9Q45mk+Gv5OfgRc/zE=; b=SLr+x5e7nVg8JbpPomHk92hBu+zacNWI4QKzXNl8zDRCavdU+la12Kn7Uok8l04x2e 4HR4fLM/4IGpdIFtdNIMB6TKF3pH2zHuJGjoVFgBXhtEN3edbeh5Ga0via4doqKwmbnS cT+0fobxupnOm2UXFHAZLV4RHQVwrQHHPWAuuUAprfcJ98wlNICyRhFA3LOlgOiUr0vd Wps7W7gQriEcpjc800bDKbVeOUqdJtgaRdWrVJn1G6wlyBkgMAZpaaPnoDrTOJJcEflH 2LXGGC0xykeNi/fGZY/URi4Czi2ji58b0fzITqtgWwIh93eOn/Nl7Wb6uetV70Xiv+Ab LzAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e124si53612700jab.5.2019.07.22.14.41.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2019 14:41:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpg2p-00031G-Qv; Mon, 22 Jul 2019 21:40:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpg2n-0002vD-Fb for xen-devel@lists.xenproject.org; Mon, 22 Jul 2019 21:40:29 +0000 X-Inumbo-ID: 517e79aa-acc9-11e9-b45d-cf2cd706ffcc Received: from foss.arm.com (unknown [217.140.110.172]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 517e79aa-acc9-11e9-b45d-cf2cd706ffcc; Mon, 22 Jul 2019 21:40:26 +0000 (UTC) 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 8C8B6152F; Mon, 22 Jul 2019 14:40:26 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DA7923F71F; Mon, 22 Jul 2019 14:40:25 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Jul 2019 22:39:46 +0100 Message-Id: <20190722213958.5761-24-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190722213958.5761-1-julien.grall@arm.com> References: <20190722213958.5761-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v2 23/35] xen/arm32: head: Introduce print_reg X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, the user should save r14/lr if it cares about it. Follow-up patches will introduce more use of putn in place where lr should be preserved. Furthermore, any user of putn should also move the value to register r0 if it was stored in a different register. For convenience, a new macro is introduced to print a given register. The macro will take care for us to move the value to r0 and also preserve lr. Lastly the new macro is used to replace all the callsite of putn. This will simplify rework/review later on. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Patch added --- xen/arch/arm/arm32/head.S | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 134c3dda92..bbcfdcd351 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -79,8 +79,25 @@ 98: .asciz _s ;\ .align 2 ;\ 99: + +/* + * Macro to print the value of register \rb + * + * Clobbers r0 - r4 + */ +.macro print_reg rb + mov r0, \rb + mov r4, lr + bl putn + mov lr, r4 +.endm + #else /* CONFIG_EARLY_PRINTK */ #define PRINT(s) + +.macro print_reg rb +.endm + #endif /* !CONFIG_EARLY_PRINTK */ .arm @@ -159,8 +176,7 @@ GLOBAL(init_secondary) #ifdef CONFIG_EARLY_PRINTK mov_w r11, EARLY_UART_BASE_ADDRESS /* r11 := UART base address */ PRINT("- CPU ") - mov r0, r7 - bl putn + print_reg r7 PRINT(" booting -\r\n") #endif @@ -211,8 +227,7 @@ skip_bss: bne 1f mov r4, r0 PRINT("- Missing processor info: ") - mov r0, r4 - bl putn + print_reg r4 PRINT(" -\r\n") b fail 1: