Message ID | 20191014160404.19553-40-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | 6ee18643770b360da0c8ee44aa07708caa516fa9 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4773349ill; Mon, 14 Oct 2019 10:06:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlPHnYY21fc4ABK9H4hs2PtEb1efuoiYLoSJj3QGer8tMDRtN3DwfwNu7xRecfyLmZaKQJ X-Received: by 2002:ac8:368b:: with SMTP id a11mr13847040qtc.362.1571072791228; Mon, 14 Oct 2019 10:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571072791; cv=none; d=google.com; s=arc-20160816; b=PWidKLyZ058LWC66swQfZrM90Th6PUCiQd6RLW4DWj+5rVwB8AYM2i24N07wxVoO88 DKwDu3MliRIny1Nl9SYl/OYtKZB1yGhWMRF5ydQDKESgeFbLevKXSRBGVCRc27ltGjYw WkizPukhXd9K1zy0khds4kjtSXFLBjJOAQ9xKywR6jSENqY0GixzY+mawV8lxJpHGsk/ SABPYTAuqRoA2zlMIydjv5rOxQkr/xq9FBmD+5JysXfZgIKx94Ude3sOdDAoHC4RT+YT DxR42lMuWRbaOoF+76s9hbd1NgjkBxjPE3b7jVLggkpqaI4wUjfrpu/HlaeBgohQnRxa eQBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=BM7ehIz5Ww7Rbyjkjbjfbg9xCinxhB61Wg4bl5OWXAg=; b=mQdLcRIx1UaStQtSvkMqf0cploc5sIq/zkDLiXqz0UnWh+xqcuE6gqSAY0OGyUJGaz hCiDNWGGQRgF30S3pCZL9CnqDqygm2SFOTA9iPHC4lBqz5XZa16lKJHgmwa8qTwE2n7x C36HjunZQ8N43Vc9ub6BSq2Aw3vpBMOC2OM+0wA2tA799AbrXIuNLAWtf89FXaGFCLpy SeuFA0WFWTgZ9+G0VVfByIcxbyvwQohOsW4SPSGU8JMzwXUUfn29zgHSjHIzg6Jcot7U WnjvQFZ3NTrObMEWpUIJPruJNTEqq7YMogiCStpjnFRDTbX7Bez7SI+XcQnLwv9J5FIW VcGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gayLlwi2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z61si17838271qtc.186.2019.10.14.10.06.30 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Oct 2019 10:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gayLlwi2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1iK3nh-0007AJ-NA for patch@linaro.org; Mon, 14 Oct 2019 13:06:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37214) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1iK2qR-0004gI-D1 for qemu-devel@nongnu.org; Mon, 14 Oct 2019 12:05:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1iK2qQ-0007tp-65 for qemu-devel@nongnu.org; Mon, 14 Oct 2019 12:05:15 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:36483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1iK2qP-0007t1-WD for qemu-devel@nongnu.org; Mon, 14 Oct 2019 12:05:14 -0400 Received: by mail-wm1-x343.google.com with SMTP id m18so17318012wmc.1 for <qemu-devel@nongnu.org>; Mon, 14 Oct 2019 09:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BM7ehIz5Ww7Rbyjkjbjfbg9xCinxhB61Wg4bl5OWXAg=; b=gayLlwi2hJehQW9Rdr8WSdD3jdF98S8Vtxlknqc8wTqGSB/JZkl9cxofFccQ9v3OVt 6eTxqM01bQz9knOQ/qHHS5mheN8bKNNL7smqkWfwfD/Sc7Q7McYU8liN4A+DzOXpl8bL 3g+NvKrb4eMqlnxYTsE6YweW76sWlm9r0z+qgmOneg8xkAd5oAooh2riW4EJ6Rr8IIyl 4Xkd9F0leJJEGtfUYaTOAa0mMm1r1is70Ms1eRX/8W5DnhTVp1NYWKC+A0VOhNFmDPTz xceOoMQAcRVPqrd27C0+aq1VP4T0GTNhWRzy9lP8QY+OMaQVRCtfTDk4aqdcGcc+hQrK 7zuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BM7ehIz5Ww7Rbyjkjbjfbg9xCinxhB61Wg4bl5OWXAg=; b=KLaqYxSMQMMKTTxf/LnIw4hjj5nywEakWN1BX0NYnvsTPaLX1o1DcUtBiHTyu3e6cC 9RGtwRNIfUjJ8W+KCVuWJhiChjpBLUEW5PnxA3r2aLSyiCnYXbMnrEApzzqtRnj/yDP9 4IHEGV62MrxqtkRLdt4svweR/J3v7FI9v04MEjvGFD2tv0zTWnBXl+hEOfsyN5k82FP5 5m+ksRNIuIaqgtfXFdLJk++wfHcUClPL6azk3SBcH/oaJJgxTPFxjL48TsSGED72AF66 dOF1za0m2B0QU2tGfknAAtQBLEvALAQCn1XnOifdtNBbaNdwohC1zQLHx5uamtfLdMzF JLtg== X-Gm-Message-State: APjAAAVWuMdhw48hEp62ewPGLGHDBy+WCr4zs6V88eFziGhI/j1NODgL o0GHih/VTIphfxMhf93x5wrkoAmt7hjzJA== X-Received: by 2002:a05:600c:21c8:: with SMTP id x8mr14542425wmj.123.1571069112610; Mon, 14 Oct 2019 09:05:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 5sm18029779wrk.86.2019.10.14.09.05.11 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 09:05:11 -0700 (PDT) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Subject: [PULL 39/68] target/arm/arm-semi: Implement SH_EXT_STDOUT_STDERR extension Date: Mon, 14 Oct 2019 17:03:35 +0100 Message-Id: <20191014160404.19553-40-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191014160404.19553-1-peter.maydell@linaro.org> References: <20191014160404.19553-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
target-arm queue
|
expand
|
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index f65d8c907e8..6f7b6d801bf 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -516,13 +516,14 @@ static uint32_t gdb_flenfn(ARMCPU *cpu, GuestFD *gf) /* Feature bits reportable in feature byte 0 */ #define SH_EXT_EXIT_EXTENDED (1 << 0) +#define SH_EXT_STDOUT_STDERR (1 << 1) static const uint8_t featurefile_data[] = { SHFB_MAGIC_0, SHFB_MAGIC_1, SHFB_MAGIC_2, SHFB_MAGIC_3, - SH_EXT_EXIT_EXTENDED, /* Feature byte 0 */ + SH_EXT_EXIT_EXTENDED | SH_EXT_STDOUT_STDERR, /* Feature byte 0 */ }; static void init_featurefile_guestfd(int guestfd) @@ -710,7 +711,21 @@ target_ulong do_arm_semihosting(CPUARMState *env) } if (strcmp(s, ":tt") == 0) { - int result_fileno = arg1 < 4 ? STDIN_FILENO : STDOUT_FILENO; + int result_fileno; + + /* + * We implement SH_EXT_STDOUT_STDERR, so: + * open for read == stdin + * open for write == stdout + * open for append == stderr + */ + if (arg1 < 4) { + result_fileno = STDIN_FILENO; + } else if (arg1 < 8) { + result_fileno = STDOUT_FILENO; + } else { + result_fileno = STDERR_FILENO; + } associate_guestfd(guestfd, result_fileno); unlock_user(s, arg0, 0); return guestfd;