From nobody Tue Feb 10 04:16:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1578496051; cv=none; d=zohomail.com; s=zohoarc; b=Y53uKgVrGCVu9ORXBk9Aw8xnV0Ym2t/+nWctONit9IsbbL+mTjG4ObtRDWomhSgeBCbt4edqm3G7Kx+RD+eaJvI/UVN/nGZ4B/igkxCLahrSkegujHdSx7X7hXrfvAE5nXtrrr+D+/TE3M484XK69hN8A6sMgHm3aV8h5suuJM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578496051; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O+jDkffcXWGWrl2ViCkscRGcA34TMzzu2DuCiFiOkiM=; b=K1EasPXYCo1hV5m8uj6AH2YlPNxcUNvCVlJ/KEWezeP5qbwdQeXPHpKirFjyssYd/CYB8gMc57bsE7CvE1cx7EtCkp6sR2Ci5gYvX6h1++v0EB+GFRYWj9VVu4ys28FkMYNnnI+v58tH6vDp+xGw4EzeinPdjYWgeHJiI3TdelA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578496051660889.207982681966; Wed, 8 Jan 2020 07:07:31 -0800 (PST) Received: from localhost ([::1]:45416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipCvi-00036e-HN for importer@patchew.org; Wed, 08 Jan 2020 10:07:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43797) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipCrP-0004nA-Bw for qemu-devel@nongnu.org; Wed, 08 Jan 2020 10:03:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipCrO-0000v3-3x for qemu-devel@nongnu.org; Wed, 08 Jan 2020 10:03:03 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:50651) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipCrN-0000uM-T4 for qemu-devel@nongnu.org; Wed, 08 Jan 2020 10:03:02 -0500 Received: by mail-wm1-x32d.google.com with SMTP id a5so2843879wmb.0 for ; Wed, 08 Jan 2020 07:03:01 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 5sm4621418wrh.5.2020.01.08.07.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 07:02:57 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 884581FF93; Wed, 8 Jan 2020 15:02:53 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O+jDkffcXWGWrl2ViCkscRGcA34TMzzu2DuCiFiOkiM=; b=WC6Pb645SD32eTokZLUUFYs16cSub/2drjdA+E2dHVPXHCoITQo+4MOI2iIlM9L0yh wZTp+GZCuI0QOi8H5O7P66tyCrpGh2C3uSd5wGboDdrnZn7hYE+NZ5IhMM942mEx67a7 VDJdb1XHwWd2wgHRA4/I62AOEsiyNm/gP2TgKxi7IfoPWdrqdjGgqh2BeRX0Un72EPKF 6iNQCOLl6djXbA4C1Apv2zWt0xRVNf5gwjGI9ot9zXvGzVW2k50l/LU9nVFwGkq/PytP UIYu0SGXryxT5b+3xv/5hYPPLECpv3KQzWubDNxzBcSnJOGdyntAlJhwVlHqk0TXIfZV wodg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O+jDkffcXWGWrl2ViCkscRGcA34TMzzu2DuCiFiOkiM=; b=VWYaapDSRZy/bbFm2WCCL/cNdfZSCS3+IRredNr8wUTbf0fFVYYKfNIn0ZUyNHDhV0 DBfQayGr07YL33IXYZZRc+o3vScIndHtfmCM0y/vFiBm6Qp6vmceO7uL7RqWyJsoqJtq hvSyjmx8UMeO2OFiJ7ByZsSQ1B394VjPz31cG0uV11fqU6XaDgKrEyIbSMNHv5Fn0BCQ 3rqXvPBs7kVmLnbGBw/tkKCqPD4DaZ9vMso8whbUBZeqwkZXrfHWO1yENQtek2M9WxjU lqscRbV29El0ZzrMqrgXbmMgGGaPxjOsX0Sr4Shg+ARqcXSaMJqaWHn2ElsdT2+/WZ+Y RSYQ== X-Gm-Message-State: APjAAAVx5WjLlsTvLM1aK/ep/M1oBA4diyvS1VpUp4VIbSfExQ3peN1F Fv2vS6TvhJx0IuobV+sREI58Mw== X-Google-Smtp-Source: APXvYqyrOjzFqVs9HXdTkjmY5ZCQNJebEOqxQ1qsQZruXODVEdPuukZHmOIrYKffjMS5i1ZuJnzyDA== X-Received: by 2002:a7b:c183:: with SMTP id y3mr4474756wmi.0.1578495780862; Wed, 08 Jan 2020 07:03:00 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 6/6] tests/tcg: add user version of dumb-as-bricks semiconsole test Date: Wed, 8 Jan 2020 15:02:52 +0000 Message-Id: <20200108150252.6216-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200108150252.6216-1-alex.bennee@linaro.org> References: <20200108150252.6216-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , keithp@keithp.com, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) There are linux-user users of semihosting so we'd better check things work for them as well. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- v3 - include aarch64 version v4 - use common semicall.h, test thumb & arm --- tests/tcg/arm/semiconsole.c | 27 +++++++++++++++++++++++++++ tests/tcg/aarch64/Makefile.target | 7 +++++++ tests/tcg/arm/Makefile.target | 19 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 tests/tcg/arm/semiconsole.c diff --git a/tests/tcg/arm/semiconsole.c b/tests/tcg/arm/semiconsole.c new file mode 100644 index 00000000000..6ef0bd24500 --- /dev/null +++ b/tests/tcg/arm/semiconsole.c @@ -0,0 +1,27 @@ +/* + * linux-user semihosting console + * + * Copyright (c) 2019 + * Written by Alex Benn=C3=A9e + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include +#include +#include "semicall.h" + +int main(void) +{ + char c; + + printf("Semihosting Console Test\n"); + printf("hit X to exit:"); + + do { + c =3D __semi_call(SYS_READC, 0); + printf("got '%c'\n", c); + } while (c !=3D 'X'); + + return 0; +} diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile= .target index 96d2321045a..4281c766419 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -32,4 +32,11 @@ run-plugin-semihosting-with-%: $(call strip-plugin,$<) 2> $<.err, \ "$< on $(TARGET_NAME) with $*") =20 +AARCH64_TESTS +=3D semiconsole +run-semiconsole: semiconsole + $(call skip-test, $<, "MANUAL ONLY") + +run-semiconsole-with-%: + $(call skip-test, $<, "MANUAL ONLY") + TESTS +=3D $(AARCH64_TESTS) diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 41aa26f4e17..a104ca30281 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -49,6 +49,25 @@ run-plugin-semihosting-with-%: $(call strip-plugin,$<) 2> $<.err, \ "$< on $(TARGET_NAME) with $*") =20 +ARM_TESTS +=3D semiconsole semiconsole-arm + +semiconsole: CFLAGS +=3D -mthumb +run-semiconsole: semiconsole + $(call skip-test, $<, "MANUAL ONLY") + +run-semiconsole-with-%: + $(call skip-test, $<, "MANUAL ONLY") + +semiconsole-arm: CFLAGS +=3D -marm +semiconsole-arm: semiconsole.c + $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) + +run-semiconsole-arm: semiconsole-arm + $(call skip-test, $<, "MANUAL ONLY") + +run-semiconsole-arm-with-%: + $(call skip-test, $<, "MANUAL ONLY") + TESTS +=3D $(ARM_TESTS) =20 # On ARM Linux only supports 4k pages --=20 2.20.1