From patchwork Mon Oct 24 13:24:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617882 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2760405pvb; Mon, 24 Oct 2022 07:30:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7RjEJEpZo2i88WKH1BtT/Y7UGRK+RPSDFUI27hqMZV9HxGdRXcWU9p/PfqIZUeN4g2QXi0 X-Received: by 2002:a05:6214:29cd:b0:4bb:67c2:ae96 with SMTP id gh13-20020a05621429cd00b004bb67c2ae96mr6556950qvb.39.1666621857863; Mon, 24 Oct 2022 07:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621857; cv=none; d=google.com; s=arc-20160816; b=cuMhoKVXeqC+BAPkcojGnDMVoC1Zl0+/MZNRZvVzQSCruMOloF+auG6C4OR74fIEMk WPescrRPg4+I9WUs06/43Gd6uox0zVBkY6WIZ17YlWdtdUo/NwZ9JARRLTMGtZ6PA1vi VL28dvL4e7HSbnNzUJ89y8LwglUUp7zvVqSisQou86y9JAu5zdNf7m2THEgX4m+fYRAY m9x3zreoIkp0ZgYYU3pa7G3p4ZdVpLJ1lKoXlXgJ1RLirm/M70lp+TQwWnuVCyR4oyPO fzmQRHGnCmH9CDRjqEMAUrr+oJguC3cUtovHOG1YvrH04Z7G2qEzxpgNbP0sqe2qbNMD ukXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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:to:from :dkim-signature; bh=t9KcFtAB+U6fMt8nUgtzl/UbXoLeJjXXCvK7XIkKin8=; b=Mg/XiNtzNstU+5jzemQvTIOumzKaQ1gaobDlntig8oiLtWFyrxYO2DcYoJQcGbB3nB QFvSzgj8QAW2qflOo57n2RROXGj3x8vNHDL+TO2Ig/om9+uWBg610LABaGVzJMeVgbgV KyBta3H3O9OdIpfJS/UqLJnLDKSW4MSzQX52b94zj3IaqR1eZUHJD+GdQm32kuqQB80+ 3TUyx5YyzqwqSS++aMT/KfWeQ+aE4EYQ1SHyhQU7WwJRvtxNzIw9V9y0k2ecSqsM8u9h TVYufr9QzNSG+GvJERT2CgkhmCq/IO9QOBgeeK10UpVW8iRDUs4y9vVN9Tc8m9HcTmtm YRiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4byWkIA; 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 q14-20020ad45cae000000b004bb639dfab3si38540qvh.432.2022.10.24.07.30.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Oct 2022 07:30:57 -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=F4byWkIA; 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 1omxTB-0003WZ-Gz; Mon, 24 Oct 2022 09:26:21 -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 1omxSj-0003PZ-AW for qemu-devel@nongnu.org; Mon, 24 Oct 2022 09:25:55 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omxSd-00041P-TH for qemu-devel@nongnu.org; Mon, 24 Oct 2022 09:25:52 -0400 Received: by mail-pj1-x102d.google.com with SMTP id m2so4136827pjr.3 for ; Mon, 24 Oct 2022 06:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=t9KcFtAB+U6fMt8nUgtzl/UbXoLeJjXXCvK7XIkKin8=; b=F4byWkIAQ6NAlCy8JpbmKsYxwq/RQ8SOmJ0aoevOaVK2VGIqp+ox/gUexWrybInDIV qxoHg1ru1ookZNlFEuD7AmHtRQXpKt4litmPa/HxTQC9EiFwl/fGKA9PES1WLeVEODco KEKVH0cQ4InhnRjnk7Tv/c3kMYCz5a+NBsBaMOGpCzScCn43pt21o/66T7V63BvjkQTr eFeUerloY0Rerw8fQVz7AlbdSrothLpb0thKGniBRopNOcEdfrkR1t6XbYhUQaizFlWF CaqxVfmf1TDfU+DGis6Q/Z1nNKu1vmt921spx+P3YOIEVI5Vag41I4UEAayroE89fgEd D3Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t9KcFtAB+U6fMt8nUgtzl/UbXoLeJjXXCvK7XIkKin8=; b=n59EPVIgLDdL1eeYJ0ekn6x2m4wcc2+Adu5mdQMDqZ2fVLkQICfeuzpeFkSONNTDDO 3QAo4L/+KjJc+huPbM93XEWaBbAQGMYQUtfXvgRfTFOMcJVZuz9lxbj+b0FUafMlRcy+ 4kTMZq9v+YT/RexAmBKlmEqILGuE7asxoM362TlpogM+zN0xfnGhZXEKcMC+Pk6WDYvv nZdN71J245m2BwGv/P2fzYV/mwzbGCaQvDEzNyZeWgd21HvhoqRCQFnGP4WxV+uFQ2/p mewfFoPrW37WCJKhP/pQywYFEI1ru1y/IwOHhRWwktE38HRFeOB2fOL5dlUpOqEP6MKW GYew== X-Gm-Message-State: ACrzQf14YxvN0uG0NShF/YP7f/AS3d3hIlmO2Rr8T5PCrGRLJkyZ2qvP k4AnRCmjywk+NQdGbIkniuNfq5sw67w/qg== X-Received: by 2002:a17:902:cac3:b0:186:6ce4:f94a with SMTP id y3-20020a170902cac300b001866ce4f94amr20707871pld.145.1666617946279; Mon, 24 Oct 2022 06:25:46 -0700 (PDT) Received: from stoup.. ([103.100.225.182]) by smtp.gmail.com with ESMTPSA id b12-20020a1709027e0c00b00178ab008364sm17009216plm.37.2022.10.24.06.25.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 06:25:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/29] target/openrisc: Convert to tcg_ops restore_state_to_opc Date: Mon, 24 Oct 2022 23:24:44 +1000 Message-Id: <20221024132459.3229709-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024132459.3229709-1-richard.henderson@linaro.org> References: <20221024132459.3229709-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.c | 13 +++++++++++++ target/openrisc/translate.c | 10 ---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index f6fd437785..de0176cd20 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -46,6 +46,18 @@ static void openrisc_cpu_synchronize_from_tb(CPUState *cs, cpu->env.pc = tb_pc(tb); } +static void openrisc_restore_state_to_opc(CPUState *cs, + const TranslationBlock *tb, + const uint64_t *data) +{ + OpenRISCCPU *cpu = OPENRISC_CPU(cs); + + cpu->env.pc = data[0]; + cpu->env.dflag = data[1] & 1; + if (data[1] & 2) { + cpu->env.ppc = cpu->env.pc - 4; + } +} static bool openrisc_cpu_has_work(CPUState *cs) { @@ -203,6 +215,7 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = { static const struct TCGCPUOps openrisc_tcg_ops = { .initialize = openrisc_translate_init, .synchronize_from_tb = openrisc_cpu_synchronize_from_tb, + .restore_state_to_opc = openrisc_restore_state_to_opc, #ifndef CONFIG_USER_ONLY .tlb_fill = openrisc_cpu_tlb_fill, diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 8154f9d744..2f3d7c5fd1 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1726,13 +1726,3 @@ void openrisc_cpu_dump_state(CPUState *cs, FILE *f, int flags) (i % 4) == 3 ? '\n' : ' '); } } - -void restore_state_to_opc(CPUOpenRISCState *env, TranslationBlock *tb, - target_ulong *data) -{ - env->pc = data[0]; - env->dflag = data[1] & 1; - if (data[1] & 2) { - env->ppc = env->pc - 4; - } -}