From patchwork Mon Jun 26 23:20:00 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: 696527 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3475336wrm; Mon, 26 Jun 2023 16:22:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+EmfxVdGcYehtVCSIBChP1LAMCVLrPVWy9FcSz0UseQE+Qd6ZfcVsP48Os6Y/dhik8eKB X-Received: by 2002:a05:620a:25ce:b0:763:dfe3:608f with SMTP id y14-20020a05620a25ce00b00763dfe3608fmr17116229qko.71.1687821760520; Mon, 26 Jun 2023 16:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687821760; cv=none; d=google.com; s=arc-20160816; b=avFkzsbHlPnp5XG7ZzJdvCG2ve2rg9dLBS1pPWfc+YLIv1jt7fFNH11K8jTERVKjtS FqledkbGHJBInMTKkhS4lwWGTjQEuGATAx95Ol2vJO6nU2a2t9JkT1MoEkQBsTFLGk1Q asG7Obupjur0XYHtVxW28IIRMYLB7C8WcVz6Q7lyt4UmSAs0Ub5FuaWsQCqdRQFKsOJ3 Gl3bhTkCLw/qyXN3wwcBreEvbaRSHJlneTGQo5IilTfwECkdrd7/K89AYVmjKbEvd8c1 DmUJQXHCMhLQzixusVTjY8T46DzpiXNlhsXseNEnHvtxTnkE7kzzReqYhAYPvKdtM9MW vVKQ== 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=Y5G3GZnisObOugerwvl7UVGEu2t0avWriP2R6IveebM=; fh=Q5PWRR3YGPXeAkQ7IpHJrCtvtZBBd6Ig9aRmT7uxHvE=; b=vDoP2E6MObQRJbcx0EZonqXsfZ6ilLMB0nFdYT/RK8n7ICxliw8ObSi96u/aR6LDwI OE9M65Laor8QjpwVEXz3llQCR5z8nnP6jAa+NQ+4ab6SYVYn3fXVetaARpujAZznlPad YEWztXn7khrB4dfg6oTlFlVRe62zpmlIrermCjgZF1t9c0s2C73ZNoLffKuwRufBM+9w Sl619LxrvGUTwkxxqJEI6XKiXvKXjh+/EQmflExQIHM/xBSieBUDfwHege3W0umzAMw0 D4cv5XvpY2gIKlA4NMFpztmv2WyRcYYIRYLCvYIGXRz2j/ikmwNoXA5EJP32ddfJjKWl FSLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WoLMAr+C; 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 l21-20020a05620a211500b0075ebdc7f009si2359499qkl.737.2023.06.26.16.22.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2023 16:22:40 -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=WoLMAr+C; 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 1qDvWF-0004ym-4l; Mon, 26 Jun 2023 19:21:15 -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 1qDvWC-0004wR-OX for qemu-devel@nongnu.org; Mon, 26 Jun 2023 19:21:12 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDvWA-0000EV-Rq for qemu-devel@nongnu.org; Mon, 26 Jun 2023 19:21:12 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-51d894b9b6cso2313298a12.3 for ; Mon, 26 Jun 2023 16:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687821667; x=1690413667; 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=Y5G3GZnisObOugerwvl7UVGEu2t0avWriP2R6IveebM=; b=WoLMAr+CiJgH4B1qgk83JpNhJB6Anw1PEQbSOH75xrkn4K9fOj93grM/N+PxivWbrU xO/K6z230taLvqq3Mh7TpjyC5FyePvSLv5GsoEFSNwyjZIV2Qacc/l17KP/qkWq6C1re +HJpvwUSkpoQDan70CBkQxNhOAqE/eJLeSev4hMughTYeMUfPV1vCB93eD2K5FyFLtzp pUjDu1CIf9TrQSPxigQFI1zfth9fw17R10Hfrs512BzTu9zA9DuqNf6CHOe5MIov7JGZ 82boGt6vwPSObe6ow5UKccJOB820mbia4TFQisPAClK8T5dn4QYWv3IBjW+cE3ghAoKF q6hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687821667; x=1690413667; 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=Y5G3GZnisObOugerwvl7UVGEu2t0avWriP2R6IveebM=; b=VcaEpgynrP4M3uWrAR9j71Kg2uYK8HpIks0QVFPIjNi6jvJ1FLsS7oGXu2iBAHC1Yh XGN8A/TsDr+p+drcm/jGcPXeB/qUeO+CAlZDetCqjZUMPAbEowCjJGr1t/hTAXN/+HSk FSa/j/a+K1DjaQRLdOEEHyDSLh8HMMDy5LNjhJryjk2Wns+Jjr1U1Dr0ychFTfdgsjIB 7n18Hh57i+hmOALW+I03teNnqOrY7fk6YcilBeFcGdZRkLQDbMjkA7tPhUaShs2IQ5/M iLirfVvkJYUsP+a79wR9Z0AEj6fjjUroVRPx4f171TOv9XHFOr046Z92ppEQQmAaY5T5 EJBQ== X-Gm-Message-State: AC+VfDyrp7LmrLFRz38YTuSmhinDTXPLB8ILEHXPDaMwyoso/tqk5AwX VfT3EDI8sLE1EfMzECYmQUWk7lIT40B9yptHbM8= X-Received: by 2002:a17:907:8a05:b0:992:13c7:563 with SMTP id sc5-20020a1709078a0500b0099213c70563mr116433ejc.75.1687821667596; Mon, 26 Jun 2023 16:21:07 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.226]) by smtp.gmail.com with ESMTPSA id k19-20020a1709061c1300b00988b32160dfsm3739150ejg.222.2023.06.26.16.21.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Jun 2023 16:21:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Liu Zhiwei , =?utf-8?q?Alex_Benn=C3=A9e?= , Thomas Huth , Beraldo Leal , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Palmer Dabbelt , Wainer dos Santos Moschetta , Daniel Henrique Barboza , Weiwei Li , qemu-riscv@nongnu.org Subject: [PATCH 09/16] target/riscv: Expose some 'trigger' prototypes from debug.c Date: Tue, 27 Jun 2023 01:20:00 +0200 Message-Id: <20230626232007.8933-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230626232007.8933-1-philmd@linaro.org> References: <20230626232007.8933-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.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-specific code from debug.c, but some functions call get_trigger_type() / do_trigger_action(). Expose these prototypes in "debug.h". Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/debug.h | 4 ++++ target/riscv/debug.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/target/riscv/debug.h b/target/riscv/debug.h index c471748d5a..65cd45b8f3 100644 --- a/target/riscv/debug.h +++ b/target/riscv/debug.h @@ -147,4 +147,8 @@ void riscv_trigger_init(CPURISCVState *env); bool riscv_itrigger_enabled(CPURISCVState *env); void riscv_itrigger_update_priv(CPURISCVState *env); + +target_ulong get_trigger_type(CPURISCVState *env, target_ulong trigger_index); +void do_trigger_action(CPURISCVState *env, target_ulong trigger_index); + #endif /* RISCV_DEBUG_H */ diff --git a/target/riscv/debug.c b/target/riscv/debug.c index 75ee1c4971..5676f2c57e 100644 --- a/target/riscv/debug.c +++ b/target/riscv/debug.c @@ -88,8 +88,7 @@ static inline target_ulong extract_trigger_type(CPURISCVState *env, } } -static inline target_ulong get_trigger_type(CPURISCVState *env, - target_ulong trigger_index) +target_ulong get_trigger_type(CPURISCVState *env, target_ulong trigger_index) { return extract_trigger_type(env, env->tdata1[trigger_index]); } @@ -217,7 +216,7 @@ static inline void warn_always_zero_bit(target_ulong val, target_ulong mask, } } -static void do_trigger_action(CPURISCVState *env, target_ulong trigger_index) +void do_trigger_action(CPURISCVState *env, target_ulong trigger_index) { trigger_action_t action = get_trigger_action(env, trigger_index);