Message ID | 20190523102532.10486-11-alex.bennee@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1992109ili; Thu, 23 May 2019 03:33:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyk50k+TjpDy236jSHpEtSLikufGEKXBaR/OOb2tU2GlF+qrQWLr1qzqth5Zn/BHOMcbBV X-Received: by 2002:a50:e79b:: with SMTP id b27mr98092456edn.281.1558607612234; Thu, 23 May 2019 03:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558607612; cv=none; d=google.com; s=arc-20160816; b=0cVAYe6pm7gKaFPeH67ZJnK7JYcSTAHIghDlSHyxSCPP/Zt46EDeh/JNPkxWlmlHnh FFM35uWbHmU7E9UrnTBrrT/Lnsimyxn1/e13ndkSE3ZNJnw/IrbQAm16zChha/tNSFDm 5fsqxmni0ybtPdsG9YvnYaH+0kxuY1bIThobCwFmkA8ZAI5t7FRs9CIZA/cFoyGt6yQg 1x37frqtABsDBb7VjlNcMc8Sr+w+afFkwyRfrqK2vQLWTlBZ/1rBZied84ZkZk76Hpra k+A9XQiaKdqlh0AyeXBTCzmk03TmZNUMIC1lNFfiIjcfVehhCJMsvU4eFu5B6wyuRQKJ 9IEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=82m0nfi4dm1nYK1jjOZA1RHXA6lw0YusU8h2ijo5ck8=; b=AvGWJ3hGtX8sZS0HY72Mp0cyfp7KojrGR9CZxpMb0iT+HsjWTY0LSn3cNDpir3HwTT 45SHQeuwaVIaSia0OLvWqAVpazEJvyzCtSAer5o21Soo9B4IyX8rLyEBo/20/UVyYJPC Q3HsO77R8veCayhlcsFG+1eHPB5tN8kv7xIRSHY0YtU6K4xXSZVpyUiMdz3TF1xvPGsY lVTD8N4TAqnN8uVij1IiyeDW7wThGXA+4YuKJ47zEY2lI+1eyUVuAKo9Bg8la50CNq31 g03pltEKc8V614zuOn595xXd3hsvn/yvfYB9/rCh7hVypvSRgRMpN8vYD+lXpNoG6IKH SOcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iHcGHSBq; 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=fail (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 v16si3821386eju.197.2019.05.23.03.33.32 for <patch@linaro.org> (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 03:33:32 -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=fail header.i=@linaro.org header.s=google header.b=iHcGHSBq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:33164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1hTl2R-00047g-7M for patch@linaro.org; Thu, 23 May 2019 06:33:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hTkvK-0005ua-08 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hTkvA-0001K2-Ns for qemu-devel@nongnu.org; Thu, 23 May 2019 06:26:06 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:40060) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1hTkv4-0000w9-C9 for qemu-devel@nongnu.org; Thu, 23 May 2019 06:25:58 -0400 Received: by mail-wm1-x342.google.com with SMTP id 15so5186358wmg.5 for <qemu-devel@nongnu.org>; Thu, 23 May 2019 03:25:40 -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=82m0nfi4dm1nYK1jjOZA1RHXA6lw0YusU8h2ijo5ck8=; b=iHcGHSBqgqA03l7DRF5mjuOailwePJ57lDnjFJ+ptwz/w3bH7QNwot5Qglu74EeDl+ 4oOAKE+StzTeBR1TS8WfuefzaxfaypReMbgoYOmZ7E7NNqXk+MM6Mjeb9LWE4DKOBuBH p9B+wD7poJczrLxz7IC9NIRjmmUAnFTIHTEjuvOjZsDp+J6dq+NvOMW2Jn7QrL51giv5 dEON2ZzgkJb2+6eoRqK92BJYoQOlgM6hjO13C9lCFOuaOLMedamiJcfG+LL7HAwC/r95 Th8ql8jwfQyGpHdAoDpiQoRIWd3cnIObbGC8tjp4mOpq+yNsB6ryHhZ6pS7dkadHyoGQ zVrA== 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=82m0nfi4dm1nYK1jjOZA1RHXA6lw0YusU8h2ijo5ck8=; b=HZbLGWLpa81Tc+o91WiaMblpKlSd6iGzVdTzWg2Cs3MBSo2J7tOzNPZPtotzY2mkej XZz+vqy/QWXhbb9wdVDvgqHoftpDM4PpYdCnqkkV0PyyvtFL+cOoP3vwEZ+OyR5DB2qA hZ0TzgwVIxDtGTAwU3rWtNMVhjBYE8u7YzyTQIxk3yhDTpA5+qPWvXO0NLpEZ93Dd57P saMrxTFI7jGLUQuiTaIwsDdKegn0h9NIwe4nEhkLZDpW6xEF2jZIIDqG+Bbaiy7j9Ivk LnsTXvpyxus6Ku7i+mYEgozbo/03ptmHzo/6ADV1MNNX1DBuG2vLnhZGHjO39n/xHQfq SNew== X-Gm-Message-State: APjAAAUClqe5/EJNpqi9oJNvolgzplhq/YfNHNNYv8fi1pwfvUGXHNne eiv0alggLBE3VhRswqGHTzw8IA== X-Received: by 2002:a7b:c844:: with SMTP id c4mr11196258wml.108.1558607139479; Thu, 23 May 2019 03:25:39 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b206sm10396597wmd.28.2019.05.23.03.25.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 03:25:35 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5D0D51FF99; Thu, 23 May 2019 11:25:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:25:14 +0100 Message-Id: <20190523102532.10486-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523102532.10486-1-alex.bennee@linaro.org> References: <20190523102532.10486-1-alex.bennee@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::342 Subject: [Qemu-devel] [PATCH v2 10/28] target/mips: convert UHI_plog to use common semihosting code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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: <http://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> Cc: Aleksandar Rikalo <arikalo@wavecomp.com>, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Aleksandar Markovic <amarkovic@wavecomp.com> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
current testing/next queue
|
expand
|
diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index eac8374fb34..35bdfd7c77e 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -23,6 +23,7 @@ #include "exec/helper-proto.h" #include "exec/softmmu-semi.h" #include "hw/semihosting/semihost.h" +#include "hw/semihosting/console.h" typedef enum UHIOp { UHI_exit = 1, @@ -329,13 +330,12 @@ void helper_do_semihosting(CPUMIPSState *env) p2 = strstr(p, "%d"); if (p2) { int char_num = p2 - p; - char *buf = g_malloc(char_num + 1); - strncpy(buf, p, char_num); - buf[char_num] = '\0'; - gpr[2] = printf("%s%d%s", buf, (int)gpr[5], p2 + 2); - g_free(buf); + GString *s = g_string_new_len(p, char_num); + g_string_append_printf(s, "%d%s", (int)gpr[5], p2 + 2); + gpr[2] = qemu_semihosting_log_out(s->str, s->len); + g_string_free(s, true); } else { - gpr[2] = printf("%s", p); + gpr[2] = qemu_semihosting_log_out(p, strlen(p)); } FREE_TARGET_STRING(p, gpr[4]); break;