From patchwork Tue Jun 28 04:53:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 585525 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp480410mab; Mon, 27 Jun 2022 23:40:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sZAuNGMyC/Y0zlrGwQLx9/7OoOcGOEDdPCXfCsWGQzM8VfcvnKU4iQbW7SrkjRdSidqqg1 X-Received: by 2002:a05:6214:811:b0:470:3b84:ea47 with SMTP id df17-20020a056214081100b004703b84ea47mr1319755qvb.59.1656398457106; Mon, 27 Jun 2022 23:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656398457; cv=none; d=google.com; s=arc-20160816; b=atfK14vZMecvm20aubEDerjE074priuIy4y+X9U4DvD2jcPTkONqRky+83/VMZO0XI qcd3Y7CoINjoKnOe5m5KCLz8ZOpdXZvOMUdC5HcIMgoZtTFZAX1lo/FW/adz82oK33DI LEq4M8X+O5k1GBxRc3Fpk91dWERmwk+8bVqdmcIRwcIVC3//jJ9EHPFhwr9KO5KWNCPC Z4UURzQNmYxy0MP1tcHhl4xY4TecDydLh2NI/iHjCVo5CFI5rsurWePRf0g63aN94AIq m2Ye+2WCwoJZbp1/4/zUgknpeP1cWx1Bhh+86gd8vKVEP4K37qKrhmdJvK91THmeIzpq UaQQ== 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:cc:to :from:dkim-signature; bh=JTrVkXiF8A1/K/SnVM2m98TUbaMDWvrW5Gsdia3GE5w=; b=vekAJQk+3Hu4OHyXzwDcNjaN+HyQBIlkLeJAfSuSm5lFfk944gnkawNnrBsnxgnH/6 nKzWMGtKER81udMaHdHoIrhoQVFo83tDHfL5EZWEL98aAN65X5kM5vmsr9l0UuzJtb1D 8eT7KWut4qWgQpsB5EDxReKKkfkLxslTEtkKzEdgWJC8+rF7EsPiTChTbUvkU1MYXg5s UIuPGuABEv0aNbYtc5GZrWC6Prl0nQPzL8dBbqpP6qXozl2xUi++b4hQYf0L2fBJfguW UrJbNC+0igKSRQEbIx34xUjNVHN/don4XnzCkyaEPvwj/0IzpVB9iGi546TMj/mC00x2 xv5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zpL9D2ZT; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 13-20020a0562140dcd00b0044643570037si6764806qvt.502.2022.06.27.23.40.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 23:40:57 -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=zpL9D2ZT; 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]:38340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o64u8-0005Wc-BJ for patch@linaro.org; Tue, 28 Jun 2022 02:40:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o63Jm-00026G-Ca for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:59:21 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:34542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o63Jk-0000Y5-VU for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:59:18 -0400 Received: by mail-pg1-x532.google.com with SMTP id g4so4176140pgc.1 for ; Mon, 27 Jun 2022 21:59:16 -0700 (PDT) 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=JTrVkXiF8A1/K/SnVM2m98TUbaMDWvrW5Gsdia3GE5w=; b=zpL9D2ZTPgE6bxTr0m803jXyixiJXkm7MyexsxIyPg1oD9xA9xAbVyYX4AqKxQxk/3 idWo21HUrtLESE9WrxfB3thd2x+5+9NERN76/EZ34SiMEz1mZt+I3UE7btDsq49ROUpO RH6FLMl2B672GQWZDnU0J8RtWcqFmO1YaBwpMa9Bcis9UNxIhurCxBw3fh8ZANGL5hXg VPE312FwYw0t2uIpp/Z5a8oXAXWw0wXeLP+SEbkouuTIhUf9064DBOK8sPXwx3OQJdFC LII37v5cdmkC+IJ1UBiut/QldA3h26Qbhz1QserfhSJ7qups8w+y4Cu1LH2HwgbDjnTo roIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JTrVkXiF8A1/K/SnVM2m98TUbaMDWvrW5Gsdia3GE5w=; b=svSYDLbFOI6MfCyJThf7XnM/O00DLO+mg7+qgHZPcZdhku02FC/Wm8TnnJ5rYnV3Ih EA6dFqE2GjIporTJvoerfdENTNQytgp5dlEhcGojrsq3Odfmr2UzJMdiZ5NxouxWnlWq yOe5WYEuWgtIvIVRZSQNl8l60LkNhfk2q7lI+Dr8EPm8SSKLiE8kzbBskAb9IGs6Y/b7 Ko/X3ldPDzLHnEFAK9T9SXenay9/Og92T+MhNt/LCArqLFxvTWn0i3pxq3G4JCY6UIh7 XmSfhzP0RdBjP38DF4KaYAMByqaIxRFICA2LkzpEuGwp3zj6yfJtoRAtwMvFIrOeTYVl W68A== X-Gm-Message-State: AJIora8R/oETL3JA7XK1VZ9sAOJPLCUTzdbXmqFY661dwRHqADbpeZCu IXRZzep534oqvIKSpKLUkFsUa+7xg9Z8Jw== X-Received: by 2002:a05:6a00:c91:b0:525:8c3f:269 with SMTP id a17-20020a056a000c9100b005258c3f0269mr2830253pfv.66.1656392355521; Mon, 27 Jun 2022 21:59:15 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id y7-20020aa78f27000000b00522c0a75c39sm8259686pfr.196.2022.06.27.21.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:59:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Luc Michel Subject: [PULL 51/60] semihosting: Use console_out_gf for SYS_WRITE0 Date: Tue, 28 Jun 2022 10:23:54 +0530 Message-Id: <20220628045403.508716-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220628045403.508716-1-richard.henderson@linaro.org> References: <20220628045403.508716-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Luc Michel Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index d61b773f98..1a1e2a6960 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -437,8 +437,15 @@ void do_common_semihosting(CPUState *cs) break; case TARGET_SYS_WRITE0: - ret = qemu_semihosting_console_outs(env, args); - common_semi_set_ret(cs, ret); + { + ssize_t len = target_strlen(args); + if (len < 0) { + common_semi_dead_cb(cs, -1, EFAULT); + } else { + semihost_sys_write_gf(cs, common_semi_dead_cb, + &console_out_gf, args, len); + } + } break; case TARGET_SYS_WRITE: