From patchwork Tue Mar 19 15:42:35 2024 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: 781115 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp1996134wrs; Tue, 19 Mar 2024 08:46:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX85o+vYYvhDTGeovuIcKJGM5oEue5pxi17VunzYhzPVcmub1XFXfiV6OYlLyTiaxsufJ8gJElssZXz7dU4HFz4 X-Google-Smtp-Source: AGHT+IHnWuCI3Vi0d5mwxhxF+3qaUYHKMfBgN39xsmJgqj89DRQGtVhkKTbur3OcZ93aF9P/adYk X-Received: by 2002:a05:620a:3907:b0:78a:f69:b946 with SMTP id qr7-20020a05620a390700b0078a0f69b946mr3735988qkn.47.1710863160552; Tue, 19 Mar 2024 08:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710863160; cv=none; d=google.com; s=arc-20160816; b=jpLGCqlShoTQcJrguKzfu+gvPN04oa/MGVXwCteLk0exf1oUvQYUAW5tBCsBtZ3Nuh 5Tuc20Pwa9hPlRqVrhrqWasaPlvnhAm8QWU0GZkJuyvL0WPvOcDateD8FEp4f8lngQf1 PIvaxNMxDqeGbFXDSIdh1/GCy/bzU91XHPv/7mX8fEaub9RjfAQh01KepxpculFQp8YZ 0+TcpTeU2XDQ4eXYQPrx6UFZQYEsPdrZYMZmvQVdhi8MXI1BAx38BL0IgIZJVXGcGvXX wQvPTEGNUMv/AqDDcliecxRJy1EF0DRW+ULOhoMHGODrHBvTqOxrDrbvOYSd/ktiSBrS 7/iA== 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=2kOlmQKWOdk+OL6bKivQd41MjZmQhEJZYUXe/hoRFYk=; fh=lWwWqzoqGOarx109Fc7K3KXcIJSuF/n6zOA5f0d2tfY=; b=k53GA9t2r3CE4YCMxajblyVnfigyx3/NoH054EW7S7H9+Z+g903ewyIT+1uyrjtqxD /Trj/REGxxYLFAZwNnMnwtP0Lw47Waw8HIqaHqcXLuRQNll12bXgBvrbF4HopNTBMSDV PTNCRk05xDg8mKXT1zEPI/QpRVJvmlM3PQzNdganjym9PsBBsQEAFQCWXwZRwbiY1nOm muV1MXpZKBIfUd21pmJveZvIP4/DBflXsQ/3yYaasbDqX0tk3yFCuYbMdi4Xkqdpuwrj UNWO0nlrNOmUVy0q/Z4hBHuf5dN5tIgMWedI0L8C7GzBrvrz453KGMARDXziCl/WPrWH g4LA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jurkxHUV; 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 k15-20020a05620a0b8f00b00789ec87f253si7313794qkh.73.2024.03.19.08.46.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2024 08:46:00 -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=jurkxHUV; 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 1rmbcu-0005Wr-2T; Tue, 19 Mar 2024 11:43:44 -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 1rmbcr-0005Ul-Lf for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:42 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbcp-0004rz-Nw for qemu-devel@nongnu.org; Tue, 19 Mar 2024 11:43:41 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33ed7ba1a42so2099346f8f.2 for ; Tue, 19 Mar 2024 08:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710863017; x=1711467817; darn=nongnu.org; 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=2kOlmQKWOdk+OL6bKivQd41MjZmQhEJZYUXe/hoRFYk=; b=jurkxHUVSIc24pBN3Fram4I9F2nMu1vzIsCMPSHhb8nZY+uyWIsKB6g7frflcdsSKJ hJhotZYFeA3Ya3hDNNmCYnGewuZPKg8FWSIuyAFX4xywyzrFxpVsga7kPq+JGSLA8eTk t4qsTnQoATBPNSGH6sQDGx0lJbUX6JskzVgqer+QmWEAIy0b1DwnQH4PbN1raHoGY4I3 qVt84nVvwSX9+0OFc60ozt/ThHVAvqf278FtE0XYmzZNmiONz7G6CGuJsLfRL8NUORWb GmvW8a2JWXvkb0sdEig8dEhLgn9NXwS3qAed2qpQiE3zqWtoDyklWFBrDrN9iZiahp/S z4EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710863017; x=1711467817; 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=2kOlmQKWOdk+OL6bKivQd41MjZmQhEJZYUXe/hoRFYk=; b=SeROMYIRFsKFikU1zGOb6LIbh2WAkKiivznG9pGoh2uxU3CTn7mbn5O2l89kqcTFD8 zqh+S2+u7gu+677xxsxFzPqNupuQFMQiAz5rRKE4FghKmHH1WM08IAnFQ4m+EQ2MB0go l6Vp+fbSj3nlxln1frn+fNx3MsWm+CFbR9LIEFZG583uBrE/EJronT43bzBrboDOgYAc dymClJvvxQqUBDqAG2XCkvQN9SstGsy6DF7ymEpzETtgmO8JsP9c0Jiq15nDOyM0IFf2 4SodFOLVDH4MR+tczaQzKwZ41lDsUPNqsi5Kh/8F2gccS1+LB/i1bjFn6bnuX02xXn49 JOqQ== X-Gm-Message-State: AOJu0Yx8dIIcInxODXxiQaUg3FCEk8gk3vcl3Yi79ZwLEnKXODZL7KVJ 6m4wzRCRVFFs/uoCOjFiX/zSeRDvYNyLSmO2Peo2S+tlu2abxn8NextCFO8FrMp1nibyCSXihYt A X-Received: by 2002:a5d:5190:0:b0:33d:82a1:626d with SMTP id k16-20020a5d5190000000b0033d82a1626dmr1877582wrv.38.1710863017273; Tue, 19 Mar 2024 08:43:37 -0700 (PDT) Received: from m1x-phil.lan ([176.176.166.129]) by smtp.gmail.com with ESMTPSA id h11-20020a5d504b000000b0033e7a102cfesm12592441wrt.64.2024.03.19.08.43.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 19 Mar 2024 08:43:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Rolnik Subject: [PATCH-for-9.1 06/27] target/avr: Convert to TCGCPUOps::get_cpu_state() Date: Tue, 19 Mar 2024 16:42:35 +0100 Message-ID: <20240319154258.71206-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240319154258.71206-1-philmd@linaro.org> References: <20240319154258.71206-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 Convert cpu_get_tb_cpu_state() to TCGCPUOps::get_cpu_state(). Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.h | 20 -------------------- target/avr/cpu.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 0c0aa580f5..284041a87a 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -193,26 +193,6 @@ enum { TB_FLAGS_SKIP = 2, }; -#define TARGET_HAS_CPU_GET_TB_CPU_STATE - -static inline void cpu_get_tb_cpu_state(CPUAVRState *env, vaddr *pc, - uint64_t *cs_base, uint32_t *pflags) -{ - uint32_t flags = 0; - - *pc = env->pc_w * 2; - *cs_base = 0; - - if (env->fullacc) { - flags |= TB_FLAGS_FULL_ACCESS; - } - if (env->skip) { - flags |= TB_FLAGS_SKIP; - } - - *pflags = flags; -} - static inline int cpu_interrupts_enabled(CPUAVRState *env) { return env->sregI != 0; diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 45ee1b5f89..c765f49c9f 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -66,6 +66,24 @@ static void avr_restore_state_to_opc(CPUState *cs, cpu_env(cs)->pc_w = data[0]; } +static void avr_get_cpu_state(CPUAVRState *env, vaddr *pc, + uint64_t *cs_base, uint32_t *pflags) +{ + uint32_t flags = 0; + + *pc = env->pc_w * 2; + *cs_base = 0; + + if (env->fullacc) { + flags |= TB_FLAGS_FULL_ACCESS; + } + if (env->skip) { + flags |= TB_FLAGS_SKIP; + } + + *pflags = flags; +} + static void avr_cpu_reset_hold(Object *obj) { CPUState *cs = CPU(obj); @@ -209,6 +227,7 @@ static const TCGCPUOps avr_tcg_ops = { .initialize = avr_cpu_tcg_init, .synchronize_from_tb = avr_cpu_synchronize_from_tb, .restore_state_to_opc = avr_restore_state_to_opc, + .get_cpu_state = avr_get_cpu_state, .cpu_exec_interrupt = avr_cpu_exec_interrupt, .tlb_fill = avr_cpu_tlb_fill, .do_interrupt = avr_cpu_do_interrupt,