From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8847C10F0E for ; Tue, 9 Apr 2019 12:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEC4920880 for ; Tue, 9 Apr 2019 12:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727281AbfDIMvH (ORCPT ); Tue, 9 Apr 2019 08:51:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51790 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbfDIMvH (ORCPT ); Tue, 9 Apr 2019 08:51:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAB8F307D90E; Tue, 9 Apr 2019 12:51:06 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 909C1272C2; Tue, 9 Apr 2019 12:51:05 +0000 (UTC) From: Andrew Jones To: kvm@vger.kernel.org Cc: alexandru.elisei@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com Subject: [PATCH kvm-unit-tests] arm: powerpc: comment halt(code) Date: Tue, 9 Apr 2019 14:51:04 +0200 Message-Id: <20190409125104.28900-1-drjones@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 09 Apr 2019 12:51:06 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We're being a bit tricky when we change the prototype of halt() to take 'code' as an argument. Doing this gives us a last chance to see it when inspecting the halted unit test state (it'll be in r0/x0 for arm/arm64 and r3 for powerpc.) Let's comment this trick to avoid confusion. Suggested-by: Alexandru Elisei Signed-off-by: Andrew Jones --- lib/arm/io.c | 10 ++++++++-- lib/powerpc/io.c | 9 +++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/arm/io.c b/lib/arm/io.c index 8226b765bdc5..99fd31560084 100644 --- a/lib/arm/io.c +++ b/lib/arm/io.c @@ -18,8 +18,6 @@ #include "io.h" -extern void halt(int code); - static struct spinlock uart_lock; /* * Use this guess for the uart base in order to make an attempt at @@ -89,6 +87,14 @@ void puts(const char *s) spin_unlock(&uart_lock); } + +/* + * Defining halt to take 'code' as an argument guarantees that it will + * be in x0/r0 when we halt. That gives us a final chance to see the exit + * status while inspecting the halted unit test state. + */ +extern void halt(int code); + void exit(int code) { chr_testdev_exit(code); diff --git a/lib/powerpc/io.c b/lib/powerpc/io.c index 217eb0770ef5..a381688bce51 100644 --- a/lib/powerpc/io.c +++ b/lib/powerpc/io.c @@ -11,8 +11,6 @@ #include #include "io.h" -extern void halt(int code); - static struct spinlock print_lock; void io_init(void) @@ -28,6 +26,13 @@ void puts(const char *s) spin_unlock(&print_lock); } +/* + * Defining halt to take 'code' as an argument guarantees that it will + * be in r3 when we halt. That gives us a final chance to see the exit + * status while inspecting the halted unit test state. + */ +extern void halt(int code); + void exit(int code) { // FIXME: change this print-exit/rtas-poweroff to chr_testdev_exit(), -- 2.20.1