From patchwork Mon Jun 26 23:20:06 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: 696525 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3475309wrm; Mon, 26 Jun 2023 16:22:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JNI87D1zJv8/wj4hxoRXxZVtpTmX4HQDxpVEkHHnMPyNMj+dLN8Wtoz3iBCdPux4ijI0E X-Received: by 2002:a05:620a:458b:b0:765:a633:43f2 with SMTP id bp11-20020a05620a458b00b00765a63343f2mr6483911qkb.12.1687821756513; Mon, 26 Jun 2023 16:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687821756; cv=none; d=google.com; s=arc-20160816; b=kna6nqDdb2MlequcMBpax8Sj+yw0xDeZyI12ODhyeYKEC/w5D43Ixm13ES0kBnhYzf Gxt2ZqW+Vnz+fnlVgvlh0XBhn7pbnxSVmufgaAFTls1zXyYo1EpU3uQhHsGfRWvE+gdB Y8oO87xr1anYXRCrrnNHCq1nGulHSenm4QugxLB0dDZEUwGvDDcRXtBY+HCVWMx6ZLn2 TVvf53md1x7saf/3UhKOgGtg0zLwJsgkZTHLNb/qvxe8H6R53iMHKSWwWA3VahFWrseS 0/oYiMS4Oq76bIQQPbr5A3/h1TB0tZLnXi8Qopp/puwt88z0M2BU7MVFvsduJ7OCKFrp v07g== 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=4zj8kiNSf4zOVBRmaIbE7s7TNCE9jUZ9Fb7cv7kKoN8=; fh=Q5PWRR3YGPXeAkQ7IpHJrCtvtZBBd6Ig9aRmT7uxHvE=; b=CXLJnL49G8wRl35FtXNfqyWFL7sIsuXrnjsd/wdyHONMy+0e6S+OsaF/7kUhPRIvfK VWvclCuNbariVPBagcD3x6k9pBKcwd60nEa6T4lOFRVGS5QiXMoZNF9IpiECAUAmQ32o SeEPViK0ddAxu/8xsE6iAzr9f/zHyg5C6tbtfSWflg88VYE/yvCvkvBQrTYNCJmi5CcH 50Zln9yoYCVZ4c7jBSWoIDQN3YT2sFym1i5Bmn4CN2UGgtSAw5knEKQa6RIIm9G5hV/m ImVPRq11BuCwdvDxylDG48L4Nio/3+pvcu7joCljmrCmb91NRMreTeODXzsGhalY8UnJ x1SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mUMyMdkp; 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 tr22-20020a05620a2d9600b00763bae523fbsi1151896qkn.273.2023.06.26.16.22.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2023 16:22:36 -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=mUMyMdkp; 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 1qDvWp-0006tx-27; Mon, 26 Jun 2023 19:21: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 1qDvWn-0006lt-6n for qemu-devel@nongnu.org; Mon, 26 Jun 2023 19:21:49 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDvWk-0000L2-VQ for qemu-devel@nongnu.org; Mon, 26 Jun 2023 19:21:48 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b698937f85so36526831fa.2 for ; Mon, 26 Jun 2023 16:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687821705; x=1690413705; 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=4zj8kiNSf4zOVBRmaIbE7s7TNCE9jUZ9Fb7cv7kKoN8=; b=mUMyMdkpXZlZOkwqKRhDSRrKPzHZ4mi6GF2+P+1pEQJQLxqN9wRchyQs6vVdtXpdqj ezqPYqhn21ZRcOyyTlrqZylQYvFCQ88ZqNW4hgyUtmJwIdNw6TAB3CUZgr2emn4TZQrn t522ERmBSlqzhexXRX+9kv67BNyBywN8LBbwJmLLpdYB5BFKRO3oVcCmZxDDksX9dF6i yWHyplE7v/qGbJ8eB9RPK6NQfQ3Z2nY4jZBIT7F7A6qqojgktLQEu9GBoxYKAxrI1R5M b6/7skHVsbDgRsr9CaV3yIijIoxPLRmHf7yC/MhTCui7qCPyPjVYbuviV0q1RWOLnHLe ON8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687821705; x=1690413705; 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=4zj8kiNSf4zOVBRmaIbE7s7TNCE9jUZ9Fb7cv7kKoN8=; b=afZN1uxP9fWFS2Os/jL4jDlDR90cQ0L4G0DkTCkB7KLwG00Guy0TicUOGGI4gOSonk MPXjmtIE1LuMLr7lj6klnshHKcGU8ppYzbuBo55u+0TVQDo48NBtYffET+x/KMYWTiIK WeT6PwQXRl3gba30Lx4pbVHeB13RQTH7zeBLwdP7WmvrjqA5LzDnSZAJrKb80ouKu87y OGXx291FUQzWA8bimr07ACQ9UlbHGspn8IE9cSINKIVgaUAuj9zucx2mqVPkBIHgFIRv aIR2ocjc7j0HGQ364fo7NXN8Zlk4yMEeix+H4lsW7AdW+jDu63zeVB7KLNwbSorhklID /E+Q== X-Gm-Message-State: AC+VfDyZmlETSizc3mMnMlqksAb7St2cSoibPNUPVHpw8s9VsICsmXNh nZ5n9ejDhW7K2xkCoG2VY164syWvBfwxZDZUap4= X-Received: by 2002:a05:651c:102a:b0:2b6:a23c:580 with SMTP id w10-20020a05651c102a00b002b6a23c0580mr2169142ljm.5.1687821705062; Mon, 26 Jun 2023 16:21:45 -0700 (PDT) Received: from m1x-phil.lan ([176.187.199.226]) by smtp.gmail.com with ESMTPSA id y3-20020aa7c243000000b0051bdf152295sm3247783edo.76.2023.06.26.16.21.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Jun 2023 16:21:44 -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 15/16] target/riscv: Restrict TCG-specific prototype declarations Date: Tue, 27 Jun 2023 01:20:06 +0200 Message-Id: <20230626232007.8933-16-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::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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 Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 3 +++ target/riscv/cpu.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 5945e13fe0..8f16655041 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -474,7 +474,10 @@ RISCVException smstateen_acc_ok(CPURISCVState *env, int index, uint64_t bit); void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv); +#ifdef CONFIG_TCG void riscv_translate_init(void); +#endif + G_NORETURN void riscv_raise_exception(CPURISCVState *env, uint32_t exception, uintptr_t pc); diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index a1513bf5cc..2371bdd68a 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -37,7 +37,9 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "fpu/softfloat-helpers.h" +#ifdef CONFIG_TCG #include "tcg/tcg.h" +#endif /* RISC-V CPU definitions */ @@ -724,6 +726,7 @@ static vaddr riscv_cpu_get_pc(CPUState *cs) return env->pc; } +#ifdef CONFIG_TCG static void riscv_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { @@ -741,6 +744,7 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs, } } } +#endif static bool riscv_cpu_has_work(CPUState *cs) { @@ -757,6 +761,7 @@ static bool riscv_cpu_has_work(CPUState *cs) #endif } +#ifdef CONFIG_TCG static void riscv_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) @@ -779,6 +784,7 @@ static void riscv_restore_state_to_opc(CPUState *cs, } env->bins = data[1]; } +#endif static void riscv_cpu_reset_hold(Object *obj) { @@ -1785,6 +1791,8 @@ static const struct SysemuCPUOps riscv_sysemu_ops = { }; #endif +#ifdef CONFIG_TCG + #include "hw/core/tcg-cpu-ops.h" static const struct TCGCPUOps riscv_tcg_ops = { @@ -1803,6 +1811,7 @@ static const struct TCGCPUOps riscv_tcg_ops = { .debug_check_watchpoint = riscv_cpu_debug_check_watchpoint, #endif /* !CONFIG_USER_ONLY */ }; +#endif /* CONFIG_TCG */ static void riscv_cpu_class_init(ObjectClass *c, void *data) { @@ -1833,7 +1842,9 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) #endif cc->gdb_arch_name = riscv_gdb_arch_name; cc->gdb_get_dynamic_xml = riscv_gdb_get_dynamic_xml; +#ifdef CONFIG_TCG cc->tcg_ops = &riscv_tcg_ops; +#endif /* CONFIG_TCG */ device_class_set_props(dc, riscv_cpu_properties); }