From patchwork Tue Jul 11 12:14:49 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: 701502 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp5680195wrs; Tue, 11 Jul 2023 05:16:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHxZWrG5qYU6+a1YFU8YOG3TYFXweQu4NzsudeBkl+RRPdn7PrVYQCEoRngXHD3R59CW4P X-Received: by 2002:a05:620a:4153:b0:765:8642:a223 with SMTP id k19-20020a05620a415300b007658642a223mr17026562qko.23.1689077804421; Tue, 11 Jul 2023 05:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689077804; cv=none; d=google.com; s=arc-20160816; b=NFexHzvazzr6q6CqfcZLKmkdibpPaszbDTzYgiRJ2SBQllCgoXMi3Z2XnwiEcHBbYu 6bL7pwy4y7PzgWEfR9EHFq9iT423XwZtr2f/EEqZ+QjfvtACWMU4vVh2HRpAs1bqVk6U Krvmb0Gu6dLTlghcpOQy24I/nZ2uGf2oyxRmAvfNcQ6NI5ZRvyQ9vs1FnrSGKtTEeYPP K7XB93s7sL8NO6jddVBIxvZJ+mCK3K/1/jw4WBSPQxvz61kNDbF1TZ4eDrNIlWnXoDPx 96Uqh0O3fFUPu/VXA742cuSa92MAPr+cDzYO/txOoRJH3WwkB07EVz1VZc6JLsyGmh45 Jrkg== 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=2qKuH1n6VH6wba+79M4ShbS8g9JCHC0RUwOvmGU6vBg=; b=ZYYMOAvJBb9gf38rmDIBQeYf8r7KDU6HHSRSSNY5V42QXgyMsCZaJb/Bd3xr4th0ho BegadV3robwQZ4vjSkCC9e389lPp+Rew1g+4hgRV6wbTwVYBxBP6PEFgk+AAh3xbbxv4 c9aay6qBt3x31cObc0y3tqqhAtYke6fCtLIzfrLiUHBWSWu8Y+v/8rXwRLm5sKKj3Omn 7BnBS0CykAgFCePZg4pl4ABM00VbIlvAR1RrE/+eIEaTlseuTBIBlZufSXi1ZwKWs7Oj tICPirxrknq+tAq5toMuJ8sKcokFSd4Tc/ehNQHRApJHiR8RhDfLeZMLV7wMvWOQ5IpO cGcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bq2YjeDI; 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 u9-20020a05620a430900b00767d04f2884si700462qko.625.2023.07.11.05.16.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2023 05:16:44 -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=Bq2YjeDI; 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 1qJCIC-0002YQ-Oq; Tue, 11 Jul 2023 08:16:33 -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 1qJCHq-00023L-FF for qemu-devel@nongnu.org; Tue, 11 Jul 2023 08:16:14 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJCHj-0005U5-A9 for qemu-devel@nongnu.org; Tue, 11 Jul 2023 08:16:09 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fbc244d307so64027985e9.1 for ; Tue, 11 Jul 2023 05:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689077761; x=1691669761; 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=Bq2YjeDIJADrVDqP0oxj+Lvkqq3O7bjCFSEB9yN7k1lrlhVky5kjGWJfiTZKmlFpqj Q+CbwQdNdfdJ11uc25w3WfN0bOh4bmAeNUmZrIZ/jJ3wT4UfEitFle2JFoRh+iSkAvhW 64gxx1qG/GBtqE2guS7hos3p8GakpqBB1FvzP+ZMrzKzsH7L9Q1LiScQC6UijeWYAAVE itnh+4QN4aFqqVeUmDjh3ZJPQ636CA0GIwgXt6TtwtyH9JmtvUWCLAZxn9Qce7LAMgHs 76CAFI/iPJT0BbU8d67hHN9rAuSLE0cEG4jCCrqb0AJP1E+fzMXJ4w0RrpJU5BkZoS6Q lMOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689077761; x=1691669761; 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=Szt5Avug8qHoSXpAH3EAiNGCRZW/IPhkdMf0ZasTjsatt10r7bGrTrfzRQJIVPNt4X DqGwgRTRK6qK0GBp/FaI3gb3pU3n1UPDpcYDAPZxY2CLUJFtauj3NdnLWZQXR37zjiLK cCHE7XV0XedpqjPQJV/mFqhGUki7kJhI9xUmYHQoiHzoaGAZKEYlElW7MYIjiVHHjiTG zj1rUITDxg0CILJgEnrRO2UcqeVH6MeDFcls2LvMiTAFIySkIhDwKAU/ZYHaNYAa15He uIQgkoQmQOJgGqPry0tpj12uHsBTWjAJstYM/9ahZ9BykpLD550R6J8mzDPEiHA63HAB PRNA== X-Gm-Message-State: ABy/qLYiIqEF0WylozzL6rdCUlBPxULzj3avqnjILgp1h98YIyaCox/o tyJW+B0lnHwYvbF3fwgUfLSYjKJ/ydaav4Ic6mM= X-Received: by 2002:a5d:43c2:0:b0:30e:3f55:ebc9 with SMTP id v2-20020a5d43c2000000b0030e3f55ebc9mr14919113wrr.13.1689077761503; Tue, 11 Jul 2023 05:16:01 -0700 (PDT) Received: from m1x-phil.lan ([176.187.194.156]) by smtp.gmail.com with ESMTPSA id z8-20020adff1c8000000b003141e86e751sm2155605wro.5.2023.07.11.05.16.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 11 Jul 2023 05:16:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, Daniel Henrique Barboza , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v3 12/16] target/riscv: Expose riscv_cpu_pending_to_irq() from cpu_helper.c Date: Tue, 11 Jul 2023 14:14:49 +0200 Message-Id: <20230711121453.59138-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230711121453.59138-1-philmd@linaro.org> References: <20230711121453.59138-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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-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é Acked-by: Alistair Francis --- 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;