From nobody Mon Feb 9 17:36:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500235616656688.9906498381529; Sun, 16 Jul 2017 13:06:56 -0700 (PDT) Received: from localhost ([::1]:46712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWpod-0002eT-58 for importer@patchew.org; Sun, 16 Jul 2017 16:06:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWpmf-0001CQ-5O for qemu-devel@nongnu.org; Sun, 16 Jul 2017 16:04:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dWpmZ-0008Qz-Nd for qemu-devel@nongnu.org; Sun, 16 Jul 2017 16:04:53 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48583) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dWpmZ-0008Q2-Fp for qemu-devel@nongnu.org; Sun, 16 Jul 2017 16:04:47 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F06A220A70; Sun, 16 Jul 2017 16:04:46 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Sun, 16 Jul 2017 16:04:46 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id B22487E17E; Sun, 16 Jul 2017 16:04:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=EA6 YlV6U3s3I0GTtEZ5g/rnbNWDidMPckGkiWlDcOdo=; b=0f50i7paiHhfTiCLAUF ZHFaqqUGwtqFqaQMlT5HykAHs51OX7Jdmb6KIE+MxkrTCJ7w5XxpS1KUllt+pumg 0dq9dJ/vfYAxIC7TN6PpgpfPsMphRQHybqc31+6RRlIQXdgbdxmXkO+USmAdvNzY l1WFAW5hadgxKuZoL2q+s18E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=EA6YlV6U3s3I0GTtEZ5g/rnbNWDidMPckGkiWlDcO do=; b=NSCOIDHXtRR7aBAa7poy0V+FpSmMFMAm/JgepzfOVlzATKTFulkzu58aO y9W6XkQEs8sfqWI8AfjILq6ROSCb5vSV57ZbadnWRL+RhtrmvwijTyvdYGTY56DN t167/nxPJF5mrdnfH5x6r8uvbZ6D93DZkBWFikUY7L+hd+/rYUmrHK/kTFRTleY/ DtUXn+UqPzI2SKQLKyKGoFUdtDHUpN15DNn2vt/S3qBoj5kWdFZbL0dbsghcWgxJ SeQPwGJgU4EHMrjYQ6yWhXWzZI1mzV3KZhd1HiB74Cr4naZo/4NBzUOVTH3Wj74R DPo2oyIGh/b0seQA8bMVrbOuzc7bQ== X-ME-Sender: X-Sasl-enc: svztcXVhl2gX8K+OeYP/TDVTY8PUDosMy0lPcBiHQ6PD 1500235486 From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Sun, 16 Jul 2017 16:04:20 -0400 Message-Id: <1500235468-15341-38-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500235468-15341-1-git-send-email-cota@braap.org> References: <1500235468-15341-1-git-send-email-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v2 37/45] tcg: introduce **tcg_ctxs to keep track of all TCGContext's X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Groundwork for supporting multiple TCG contexts. Note that having n_tcg_ctxs is unnecessary. However, it is convenient to have it, since it will simplify iterating over the array: we'll have just a for loop instead of having to iterate over a NULL-terminated array (which would require n+1 elems) or having to check with ifdef's for usermode/softmmu. Signed-off-by: Emilio G. Cota --- tcg/tcg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index f907c47..8094278 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -115,6 +115,8 @@ static int tcg_target_const_match(tcg_target_long val, = TCGType type, static void tcg_out_tb_init(TCGContext *s); static bool tcg_out_tb_finalize(TCGContext *s); =20 +static TCGContext **tcg_ctxs; +static unsigned int n_tcg_ctxs; =20 static TCGRegSet tcg_target_available_regs[2]; static TCGRegSet tcg_target_call_clobber_regs; @@ -323,6 +325,13 @@ static GHashTable *helper_table; static int indirect_reg_alloc_order[ARRAY_SIZE(tcg_target_reg_alloc_order)= ]; static void process_op_defs(TCGContext *s); =20 +static void tcg_ctxs_init(TCGContext *s) +{ + tcg_ctxs =3D g_new(TCGContext *, 1); + tcg_ctxs[0] =3D s; + n_tcg_ctxs =3D 1; +} + void tcg_context_init(TCGContext *s) { int op, total_args, n, i; @@ -381,6 +390,7 @@ void tcg_context_init(TCGContext *s) indirect_reg_alloc_order[i] =3D tcg_target_reg_alloc_order[i]; } =20 + tcg_ctxs_init(s); tcg_ctx =3D s; } =20 --=20 2.7.4