From nobody Tue Nov 4 13:11:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1504133818737762.8458328114156; Wed, 30 Aug 2017 15:56:58 -0700 (PDT) Received: from localhost ([::1]:53121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnBuq-0007Kx-8b for importer@patchew.org; Wed, 30 Aug 2017 18:56:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnBqv-0003RK-Td for qemu-devel@nongnu.org; Wed, 30 Aug 2017 18:52:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnBqr-0002FC-2g for qemu-devel@nongnu.org; Wed, 30 Aug 2017 18:52:53 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33595) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dnBqq-0002F4-Us for qemu-devel@nongnu.org; Wed, 30 Aug 2017 18:52:49 -0400 Received: by mail-qk0-x242.google.com with SMTP id k126so3144037qkb.0 for ; Wed, 30 Aug 2017 15:52:48 -0700 (PDT) Received: from yoga.offpageads.com ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id 54sm4449874qts.31.2017.08.30.15.52.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 15:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ONmHwbJZQbWdUMfwFZDvAsxolFWwTDLqOZWkKpEwQ2Q=; b=NLp0Qjsbn2GygeKhNMEqselJNdoQ6QM73J2qzlNiQ49zfHH8P4PYdnNaCaVsL0Qrvq 80IPjl5MvmcyGbQR9FFl5d20TAEQRah6kPPkhUStfOWrBNRsTd/EPzvvA5Ma3cZieFrX qRJLYJSiVH1crGin+3iHinj39jEYVk+XBJiRjOICCoJyq5dCoWdClwSJs421uC1vnkzM EnplZH59TvcB3ysdUVcbeJrjFdYD5KIq316JidKGsokLXwunDNX6o7B0EjBw3Ep8BEfe CTET9WJcVKWIZKWqMgp7YgPI7ftFAbL1XDcG8VauFLMIKp3M2hSscm82LaGaLZLf6o7g 7ugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ONmHwbJZQbWdUMfwFZDvAsxolFWwTDLqOZWkKpEwQ2Q=; b=Ahepyke5m/05KtVp9hqlMIJTS9Q2cMiyXRFVDt7FB12eTNVrLHyiLn+EHCIzRaNuK7 TLE/OjgGpYl7tKyOW3lDTV6MiszlBrGO2F1EsAScqo7LfpQ+m39E79YdrqkTTrhif7Hy uOZ0B6jHaTdjIg/fJX10BeYN4lxGyYpL/N2OmzU9e7PPCHYuR+AQWIxTYZP6K0RH5dgr yvDRvsVjqYd1n9yWQu7clfwzzl/MOv0ejb2sAHu9pSgLy6MPFE1HNc+quIdgkq25krWz 6O9bHp2AwUxz04uArKVdKC5KiB+GWuomI2SVWay0s+XBDp8pBEwLElIOL5Gkwdo6yp5E v9Vg== X-Gm-Message-State: AHPjjUiQZTV//j0c9NT12lz50qLOvVWGPpctlI753uMj6yajFHBWV4cN jyK0nLmM6zZC0Q== X-Received: by 10.55.57.77 with SMTP id g74mr1291740qka.186.1504133568262; Wed, 30 Aug 2017 15:52:48 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Igor Mammedov , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Aurelien Jarno , Eduardo Habkost , Marcel Apfelbaum , James Hogan , Yongbok Kim Date: Wed, 30 Aug 2017 19:52:21 -0300 Message-Id: <20170830225225.27925-4-f4bug@amsat.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170830225225.27925-1-f4bug@amsat.org> References: <20170830225225.27925-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH v2 3/7] mips: split cpu_mips_realize_env() out of cpu_mips_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 so it can be used in mips_cpu_realizefn() in the next commit Signed-off-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Igor Mammedov Tested-by: James Hogan Reviewed-by: Eduardo Habkost --- target/mips/internal.h | 1 + target/mips/translate.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 91c2df4537..cf4c9db427 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -132,6 +132,7 @@ void mips_tcg_init(void); =20 /* TODO QOM'ify CPU reset and remove */ void cpu_state_reset(CPUMIPSState *s); +void cpu_mips_realize_env(CPUMIPSState *env); =20 /* cp0_timer.c */ uint32_t cpu_mips_get_random(CPUMIPSState *env); diff --git a/target/mips/translate.c b/target/mips/translate.c index f0febaf1b2..5fc7979ac5 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -20512,6 +20512,17 @@ void mips_tcg_init(void) =20 #include "translate_init.c" =20 +void cpu_mips_realize_env(CPUMIPSState *env) +{ + env->exception_base =3D (int32_t)0xBFC00000; + +#ifndef CONFIG_USER_ONLY + mmu_init(env, env->cpu_model); +#endif + fpu_init(env, env->cpu_model); + mvp_init(env, env->cpu_model); +} + MIPSCPU *cpu_mips_init(const char *cpu_model) { MIPSCPU *cpu; @@ -20524,13 +20535,7 @@ MIPSCPU *cpu_mips_init(const char *cpu_model) cpu =3D MIPS_CPU(object_new(TYPE_MIPS_CPU)); env =3D &cpu->env; env->cpu_model =3D def; - env->exception_base =3D (int32_t)0xBFC00000; - -#ifndef CONFIG_USER_ONLY - mmu_init(env, def); -#endif - fpu_init(env, def); - mvp_init(env, def); + cpu_mips_realize_env(env); =20 object_property_set_bool(OBJECT(cpu), true, "realized", NULL); =20 --=20 2.14.1