From patchwork Mon Jul 3 18:31:38 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: 698721 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1890467wrs; Mon, 3 Jul 2023 11:32:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xvgvK6fVpkcmAiJ33ep06KSDaxl8y0cJK+67YEXAi9npjjsKXAYGvvZ1zEd+kZZAlxC1j X-Received: by 2002:a05:620a:24d3:b0:767:1f3d:5d15 with SMTP id m19-20020a05620a24d300b007671f3d5d15mr12765518qkn.23.1688409176309; Mon, 03 Jul 2023 11:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688409176; cv=none; d=google.com; s=arc-20160816; b=Lk5PFiWJEd2L95fvF3hbv/Einws/bnWtFaDq1+S5oPCcx+Sz9Vr7xF8YEj7YZUinwG SA0dCUFrmvlYBUTjKM4XF0H1buh3PT8ogwMqa1j+4ezEoz5BAgI7AdN9wBFioYoqp9y9 YmlkDGW/4/FGjCv1x2PPwsxj8yF1fytyx1/UIfBrjzjAKlTYCZ6PIaQih0XqY3EsMbun owXG0v9fbaDiC6X5f8heeM1rcEBYlpD0DTeggIexaOqNSkZtH9D7bF4eavVOD44UhBg3 ar3AgluvX1lPSD7m7MEEOgElbnNienwlcsUTOjEEbBp3eHo3ofzCtFPU6zP33pzCqJ5e 3Xow== 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=vvMppja281vKOzNTqm/8B9R+cnANR9RxW7IMPTmCJ4Q=; b=XHizg4fAu0evwBFqj6PUZjWB+ggFKxYt1ROicOovjjDwbrZOMvJcdzeT9ai/LCTXY3 g9iR73kaoxp/HhnYEeiBw4825MDtjhs/wRSI4IGBWi9+/6a6LLxZaP90uWfJRtzcmgTv FAgW/uLrCg4gwTXFW3mKWp/JJRxoIdQolosLQ/enms8J6wEnTAWburhffiOHKRSTnE8Y IowUipDhAAQGJMLWTiBlYxCoY9g08t0JrmXuNJZqZPbRa8nlgDKlbZIj9ju0AlsCnDYp QfKqx73kHyIzt9YwdvcVkXORm38rUPDGs34JvMD7WYnwj3u5hZooEyxmuOkyLOy3jHku MZZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gArLSy6U; 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 k8-20020a05620a414800b00765283fcf29si12300607qko.463.2023.07.03.11.32.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 11:32:56 -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=gArLSy6U; 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 1qGOLz-0007w6-TP; Mon, 03 Jul 2023 14:32:51 -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 1qGOLy-0007v7-3p for qemu-devel@nongnu.org; Mon, 03 Jul 2023 14:32:50 -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 1qGOLw-0000Mw-H1 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 14:32:49 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fba545d743so63148545e9.0 for ; Mon, 03 Jul 2023 11:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688409166; x=1691001166; 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=gArLSy6UVnwhbUvId2CPKgLMDrnRG+LSn8P3Y9zKm3qKRdS8QwkfZVJZ2207HtTRgB iihho0KTaU6KcfKiFae/vh7wpkYSQt//pGXBnvf0O3XxYtaIO13Gl3kuKEB12IG4tmw6 SyDE6qCSpfhIa0+vXELSpH82eB9hXBIAVopshElO1yZ6x2CGPD5+ZRr1Q+VXJh5QESdE x3YL3CGEkwkhaCjWiHE+1qNv/RKN4E3iw1hgRI1WPJiw70KP9TGRGRWXj7rYFpHcCmGt DOYtf2FbPXTocF4UFbURftbvhe2tNEvJ4PKx/kPER44ur8W2yajlLHWWu7so/JZMzRee CnWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688409166; x=1691001166; 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=IMzxNIUVD9FQG/0gHG7g21OO7iHll6JkXFIUOJYw6vBqTNpqYjxxrQo8eAqnWZw5Fk 6/J9+3r8ka0lL9ftXeRgrDtxFCmX3/KTh6F6Jm83UL87Usy9Ycwm0dvkW5DgszDmssg4 zy6PYHWCKcw0znMHz1x4r/0q+rzK5Kz7jrEA0KdnN3+DwTyQUyZe9Y0uoi+5RSsfZHZ5 dlTDnf+o26F64G504Su2Hu47mOg35Rlk7jqz/KxHrnLiZJgz5Vc1tWTCcRh8DFqz50Jg a8m3Q7KIYd3PpcmBgB4RzN6kLrPrF0/sOqkNVeJUQEYP6brgXwREs219lBnA0A74LB1Z qHdA== X-Gm-Message-State: AC+VfDzVDPW+XY5MffqVAgRZhFXgxoZ0jUWDvQvB+agR5lxunrkWm2fS 6+Vn7LjvL3cKudF8IyyN/5in3HEWsBkYWW6djPqHbA== X-Received: by 2002:a7b:c858:0:b0:3fa:98f8:225f with SMTP id c24-20020a7bc858000000b003fa98f8225fmr10164667wml.26.1688409166721; Mon, 03 Jul 2023 11:32:46 -0700 (PDT) Received: from localhost.localdomain ([176.176.178.91]) by smtp.gmail.com with ESMTPSA id m21-20020a7bcb95000000b003faabd8fcb8sm21628765wmi.46.2023.07.03.11.32.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 03 Jul 2023 11:32:46 -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 09/16] target/riscv: Expose some 'trigger' prototypes from debug.c Date: Mon, 3 Jul 2023 20:31:38 +0200 Message-Id: <20230703183145.24779-10-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::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=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-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);