From patchwork Mon Aug 12 17:30:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 171109 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp3120226ily; Mon, 12 Aug 2019 10:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqylKnLbuo57lbaYlKYZNxw3xicns334ORzJMJrDC38/rds2+UDa5+XQ8UJB7Eq0Tlzh2qVw X-Received: by 2002:a02:3745:: with SMTP id r66mr13614377jar.23.1565631106926; Mon, 12 Aug 2019 10:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565631106; cv=none; d=google.com; s=arc-20160816; b=BQiVtXX5N3J7IK5jyfe5yefCa7XtGjT0NvaTyNJOHQWS6fQOF4eaInx+RJIe3QNkkz p7t3hmg/vCDhxBChKr3L/64u5Q8jHleUFzTFIe5yd0aZbnJU0dilXYbV//EPBGXrL9vY w6hRhxl8Vi264n2YDeaAgNiTKK4TGH5sQFFJ215Vb3IVWmikx+gzrH8hJ/Z8Urx5AYQ3 M52XwKOPupaHsS/YqM7MRip00k6G402cIXM4BPov3QClWU+Gy3IxZWQDkYrgJjVRmcl9 7GYJSQh8wcrU0SbtWxXqjgaAr13CDyEhvCvKiInQKvywcahjh6ZR56lJreyj6PFO9FwJ QXGw== 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=GKSyRuIwKG7ddAAnZeH3xqr6moOoK9mkUhIyW2f1kPk=; b=Eh0Ks+QUae335ozVBCVwE2Mk75+vqyX6LRyB3NVP2bPPWjw9Uk03jGdm8o9Zxn3rft SCnWebT0p98fQKHXvzMLwrfQFJYXjGdampknq3Svv/GQuGvepkd7R51nQbTujRd+YVHP bda5YOqaEKbm+DsHJ2TISYuSt20WK2v/1iBTiPF/P4rMP6Qy2p8B44PMpFkthUXT2a+j NP3ijPdw+tKAEAmF+cmHRiXqTE8ntJR9nlYinqXdpxu1ln59QT2lrle6Z1OJEb3AFcLN KVtm6QJUxD7Tiq2h7937M6LvXZrj7BO13mWKUI5FTiQNnnzDuevogKUCf0CPxar64r5a P3JQ== 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 d14si145587329jaq.25.2019.08.12.10.31.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Aug 2019 10:31:46 -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 1hxE9Y-0006kd-By; Mon, 12 Aug 2019 17:30:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxE9W-0006iQ-TC for xen-devel@lists.xenproject.org; Mon, 12 Aug 2019 17:30:38 +0000 X-Inumbo-ID: e65def37-bd26-11e9-8980-bc764e045a96 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id e65def37-bd26-11e9-8980-bc764e045a96; Mon, 12 Aug 2019 17:30:38 +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 2E21C174E; Mon, 12 Aug 2019 10:30:38 -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 7C38A3F706; Mon, 12 Aug 2019 10:30:37 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 12 Aug 2019 18:30:03 +0100 Message-Id: <20190812173019.11956-13-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190812173019.11956-1-julien.grall@arm.com> References: <20190812173019.11956-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH v3 12/28] 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 v3: - Add Stefano's reviewed-by 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 fd3a273550..c4ee06ba93 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: