From patchwork Mon Jul 3 18:31:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 698731 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1891589wrs; Mon, 3 Jul 2023 11:35:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZfQq52uXpTyqaD7Obxs6cOryC0s2ldkfd5qzqhk1nfDF5tBfFcRL2kXSb70vduKaNj/zp X-Received: by 2002:a05:620a:258e:b0:765:83e8:d990 with SMTP id x14-20020a05620a258e00b0076583e8d990mr12076952qko.75.1688409339620; Mon, 03 Jul 2023 11:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688409339; cv=none; d=google.com; s=arc-20160816; b=wEK2gGgG0Ca7KMI6jBedZFTIpKJAB/w9qthKbNbMRBupigCs60O4R5GICrZ9Np/4bF tY19h+UfH1wGDNzMwExy2kipawLdim5URFZozmOiTJDfEHtOzVWsAnMjUvKmQ0lddvJd LpM6LMiKUaJGdG9DeKstMDuaqMjlUFhJzWYTsCx/spTbO5r62COqg+c2Xnpcq/CmHGLV h2sYdf2NONfr5bepnuqdHnqg3V7S7d2Rvcv07c0iaqyjd4aokjFw0FOE8j4R4if1r+Yh FfPhJ1ku8341fS6iMXfJ86CZKbvukr7gbrnSLZGLaV5GLE5KCzm1MtflCEAG1LdEOPz3 9bVQ== 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=YxoVzJhi2n2dGTE2zLar6uJBuHBuoJDv5oC7y/6cp9w=; fh=vvMppja281vKOzNTqm/8B9R+cnANR9RxW7IMPTmCJ4Q=; b=CGieHc5y5YNa167pi/82svJwEEmL3YNWx2BIUt+mBqg967jqmW4aoOLdQU1tVK8Q8P GdW/KQltJN0A5STWZSIT20W7vBwNQ+RVQ58AmD17JkUtoUnaEEvPxh9BDfdU0LKBN15z hzKk7MFc7pDJQ3Zw+iPI7aG7IXlipoKSYe7oy/ooUw5BdyVF6jDsgNycbPL2KKOAbo+B EbHUfBqTgtTJ6Lf9c85xJmvVuB7gWvOLyrC2HeqrCGxBn6XLBDxwjpPQtW05ztyvwO2R spbYMRaVR9QFZIBHjGSaUXeGV+Udb4opCbe0txbJe4Uejc4u8lhzTeoiM4jw3euD2K2w L3OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y+XaAPfy; 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 sn8-20020a05620a948800b007672b66b821si7767083qkn.36.2023.07.03.11.35.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 11:35:39 -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=Y+XaAPfy; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGOMI-0000dx-JJ; Mon, 03 Jul 2023 14:33:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGOMG-0000Ur-RB for qemu-devel@nongnu.org; Mon, 03 Jul 2023 14:33:08 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGOMF-0000Pz-8i for qemu-devel@nongnu.org; Mon, 03 Jul 2023 14:33:08 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fbc244d3a8so49088145e9.2 for ; Mon, 03 Jul 2023 11:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688409186; x=1691001186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YxoVzJhi2n2dGTE2zLar6uJBuHBuoJDv5oC7y/6cp9w=; b=Y+XaAPfyeufkxXFOIiWfxi52RTughpAnKhc71LcwVPTCA8FTatE5LGefW/KS397BnL RJ47XP8hkOQdw2TCXmk+QLXZFQr4r1K7orTEIwOXqJhHrTqHvTeRVeW/v8tMeimxCh6A geBbqxpS6pdQ9hAr0XuCXxg3mruE02cogHRHgvpZ/lY19SCxT+sITiGAyVyEkN9d8ie+ NyuPGWfjvqhJetpue9ah+vxb2REJx/Elb4jaYVpqNLwVsVQPzAB+FSyYxQxHfDk4V3IJ ZuwwoKX2ormZu4HpOZrol9Jkk16bsQp2Cr/4L+T7mFJxU8gZFDUK6u1oOXlzyWLwwF9z S8Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688409186; x=1691001186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YxoVzJhi2n2dGTE2zLar6uJBuHBuoJDv5oC7y/6cp9w=; b=O4BYgBSbnJ7dO42mLRtWVs5mCpXAu4+4/dsxF8Jh+cprFmeqz37NPbOBMzmperVzBg 4qeunoSeTLMAKN+S6i3eDLtUytkQ3Ol0EklaPCmwjeinKlQEGQ0QgPbtGmKDAubBURkX 798pDVrxW285mEf9BapS2NGSkdICXHPm9dPFwWtUSwIJXjh0Nr2WYGYwoCqLmbrNcBCW TYE73+1/S6nWOVqBabgE8V42iPuqPGPiJOMX9i51azrEltHmlgvkwTc/AzIHzVwX0k1O QwCN21zZI5Dv2M99O9lpgUmzlMGwY5Q+vOc7S5ww42jKwz9DQKjvrPYRYJ7JU8ElS1L/ G1FA== X-Gm-Message-State: AC+VfDxOyBc4sUYTePSAkiyqVtKkEmurc36E702Wbpma2yT8pYTJdtgs ykxYsmpUwegzI7k6AIjT8DUUjS+0Z53Rm+49u/i7pg== X-Received: by 2002:a05:600c:ac8:b0:3f7:e65b:5252 with SMTP id c8-20020a05600c0ac800b003f7e65b5252mr9449372wmr.1.1688409185870; Mon, 03 Jul 2023 11:33:05 -0700 (PDT) Received: from localhost.localdomain ([176.176.178.91]) by smtp.gmail.com with ESMTPSA id l1-20020adff481000000b003113ed02080sm26043073wro.95.2023.07.03.11.33.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 03 Jul 2023 11:33:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Palmer Dabbelt , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Beraldo Leal , Wainer dos Santos Moschetta , Alistair Francis , Daniel Henrique Barboza , kvm@vger.kernel.org, qemu-riscv@nongnu.org, Bin Meng , =?utf-8?q?Alex_Be?= =?utf-8?q?nn=C3=A9e?= , Weiwei Li , Liu Zhiwei Subject: [PATCH v2 12/16] target/riscv: Expose riscv_cpu_pending_to_irq() from cpu_helper.c Date: Mon, 3 Jul 2023 20:31:41 +0200 Message-Id: <20230703183145.24779-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230703183145.24779-1-philmd@linaro.org> References: <20230703183145.24779-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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=unavailable 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-bounces+patch=linaro.org@nongnu.org We want to extract TCG/sysemu-specific code from cpu_helper.c, but some functions call riscv_cpu_pending_to_irq(). Expose the prototype in "internals.h". Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/internals.h | 4 ++++ target/riscv/cpu_helper.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index b5f823c7ec..b6881b4815 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -72,6 +72,10 @@ target_ulong fclass_d(uint64_t frs1); #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_riscv_cpu; + +int riscv_cpu_pending_to_irq(CPURISCVState *env, + int extirq, unsigned int extirq_def_prio, + uint64_t pending, uint8_t *iprio); #endif enum { diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 6c773000a5..e73cf56e5c 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -256,9 +256,9 @@ uint8_t riscv_cpu_default_priority(int irq) return default_iprio[irq] ? default_iprio[irq] : IPRIO_MMAXIPRIO; }; -static int riscv_cpu_pending_to_irq(CPURISCVState *env, - int extirq, unsigned int extirq_def_prio, - uint64_t pending, uint8_t *iprio) +int riscv_cpu_pending_to_irq(CPURISCVState *env, + int extirq, unsigned int extirq_def_prio, + uint64_t pending, uint8_t *iprio) { int irq, best_irq = RISCV_EXCP_NONE; unsigned int prio, best_prio = UINT_MAX;