From patchwork Fri Mar 2 11:57:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Koppelmann X-Patchwork-Id: 10254493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3167560211 for ; Fri, 2 Mar 2018 11:59:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EA5728970 for ; Fri, 2 Mar 2018 11:59:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1330E28971; Fri, 2 Mar 2018 11:59:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D501D28975 for ; Fri, 2 Mar 2018 11:59:26 +0000 (UTC) Received: from localhost ([::1]:34378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erjLS-00032f-2f for patchwork-qemu-devel@patchwork.kernel.org; Fri, 02 Mar 2018 06:59:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erjK2-0001oD-Kw for qemu-devel@nongnu.org; Fri, 02 Mar 2018 06:57:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erjJy-0001zT-P3 for qemu-devel@nongnu.org; Fri, 02 Mar 2018 06:57:58 -0500 Received: from mail.uni-paderborn.de ([131.234.142.9]:46786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erjJy-0001xw-Dt for qemu-devel@nongnu.org; Fri, 02 Mar 2018 06:57:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.uni-paderborn.de; s=20170601; h=References:In-Reply-To:Message-Id:Date :Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ooa0Ypo0Pn1iLB6TPYc+gLS2CnIXZTzJ8oWpZUR5Kl4=; b=Hb8H9QZCTBx9NZXw8ALGLAFbj xjHrGkaLtoRUtoaay/MUL2PnvCgr1jgEECaJU51KF7cxWz88g+sFKIczLLIocWeL1jq0ynxnRCj7j hazPnxZivI+pYt/DPmTi4/h/PeCf/0GDP1+LP++PN/qx/5GUDxZI09y+p+4ZUmGsfxiTo=; From: Bastian Koppelmann To: peter.maydell@linaro.org Date: Fri, 2 Mar 2018 12:57:42 +0100 Message-Id: <20180302115743.3409-4-kbastian@mail.uni-paderborn.de> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302115743.3409-1-kbastian@mail.uni-paderborn.de> References: <20180302115743.3409-1-kbastian@mail.uni-paderborn.de> X-IMT-Spam-Score: 0.0 () X-PMX-Version: 6.4.2.2738846, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.3.2.115116, AntiVirus-Engine: 5.46.1.0, AntiVirus-Data: 2018.2.23.5461000 X-IMT-Authenticated-Sender: uid=kbastian,ou=People,o=upb,c=de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 131.234.142.9 Subject: [Qemu-devel] [PULL 3/4] tricore: renamed masking of IE 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: Florian Artmeier , David Brenken , qemu-devel@nongnu.org, Georg Hofstetter Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: David Brenken between 1.3 ISA and 1.6 ISA the IE mask has changed. We reflect this by add an ISA suffix to the existing mask and add the corresponding mask for 1.6. Signed-off-by: David Brenken Signed-off-by: Florian Artmeier Signed-off-by: Georg Hofstetter Message-Id: <20180301155619.8640-4-david.brenken@efs-auto.org> Signed-off-by: Bastian Koppelmann [BK: Add why we did this change to the commit message] --- target/tricore/cpu.h | 3 ++- target/tricore/op_helper.c | 17 +++++++++-------- target/tricore/translate.c | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 045126181a..6d89f625d0 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -256,7 +256,8 @@ void tricore_cpu_dump_state(CPUState *cpu, FILE *f, #define MASK_CPUID_REV 0x000000ff #define MASK_ICR_PIPN 0x00ff0000 -#define MASK_ICR_IE 0x00000100 +#define MASK_ICR_IE_1_3 0x00000100 +#define MASK_ICR_IE_1_6 0x00008000 #define MASK_ICR_CCPN 0x000000ff #define MASK_FCX_FCXS 0x000f0000 diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 098f217c2a..475b6ce081 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -85,7 +85,7 @@ raise_exception_sync_internal(CPUTriCoreState *env, uint32_t class, int tin, /* PCXI.PIE = ICR.IE */ env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) + - ((env->ICR & MASK_ICR_IE) << 15)); + ((env->ICR & MASK_ICR_IE_1_3) << 15)); /* PCXI.PCPN = ICR.CCPN */ env->PCXI = (env->PCXI & 0xffffff) + ((env->ICR & MASK_ICR_CCPN) << 24); @@ -2465,7 +2465,7 @@ void helper_call(CPUTriCoreState *env, uint32_t next_pc) ((env->ICR & MASK_ICR_CCPN) << 24); /* PCXI.PIE = ICR.IE; */ env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) + - ((env->ICR & MASK_ICR_IE) << 15)); + ((env->ICR & MASK_ICR_IE_1_3) << 15)); /* PCXI.UL = 1; */ env->PCXI |= MASK_PCXI_UL; @@ -2563,7 +2563,7 @@ void helper_bisr(CPUTriCoreState *env, uint32_t const9) ((env->ICR & MASK_ICR_CCPN) << 24); /* PCXI.PIE = ICR.IE */ env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) + - ((env->ICR & MASK_ICR_IE) << 15)); + ((env->ICR & MASK_ICR_IE_1_3) << 15)); /* PCXI.UL = 0 */ env->PCXI &= ~(MASK_PCXI_UL); /* PCXI[19: 0] = FCX[19: 0] */ @@ -2571,7 +2571,7 @@ void helper_bisr(CPUTriCoreState *env, uint32_t const9) /* FXC[19: 0] = new_FCX[19: 0] */ env->FCX = (env->FCX & 0xfff00000) + (new_FCX & 0xfffff); /* ICR.IE = 1 */ - env->ICR |= MASK_ICR_IE; + env->ICR |= MASK_ICR_IE_1_3; env->ICR |= const9; /* ICR.CCPN = const9[7: 0];*/ @@ -2603,7 +2603,8 @@ void helper_rfe(CPUTriCoreState *env) } env->PC = env->gpr_a[11] & ~0x1; /* ICR.IE = PCXI.PIE; */ - env->ICR = (env->ICR & ~MASK_ICR_IE) + ((env->PCXI & MASK_PCXI_PIE) >> 15); + env->ICR = (env->ICR & ~MASK_ICR_IE_1_3) + + ((env->PCXI & MASK_PCXI_PIE) >> 15); /* ICR.CCPN = PCXI.PCPN; */ env->ICR = (env->ICR & ~MASK_ICR_CCPN) + ((env->PCXI & MASK_PCXI_PCPN) >> 24); @@ -2627,7 +2628,7 @@ void helper_rfm(CPUTriCoreState *env) { env->PC = (env->gpr_a[11] & ~0x1); /* ICR.IE = PCXI.PIE; */ - env->ICR = (env->ICR & ~MASK_ICR_IE) | + env->ICR = (env->ICR & ~MASK_ICR_IE_1_3) | ((env->PCXI & MASK_PCXI_PIE) >> 15); /* ICR.CCPN = PCXI.PCPN; */ env->ICR = (env->ICR & ~MASK_ICR_CCPN) | @@ -2694,7 +2695,7 @@ void helper_svlcx(CPUTriCoreState *env) ((env->ICR & MASK_ICR_CCPN) << 24); /* PCXI.PIE = ICR.IE; */ env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) + - ((env->ICR & MASK_ICR_IE) << 15)); + ((env->ICR & MASK_ICR_IE_1_3) << 15)); /* PCXI.UL = 0; */ env->PCXI &= ~MASK_PCXI_UL; @@ -2737,7 +2738,7 @@ void helper_svucx(CPUTriCoreState *env) ((env->ICR & MASK_ICR_CCPN) << 24); /* PCXI.PIE = ICR.IE; */ env->PCXI = ((env->PCXI & ~MASK_PCXI_PIE) + - ((env->ICR & MASK_ICR_IE) << 15)); + ((env->ICR & MASK_ICR_IE_1_3) << 15)); /* PCXI.UL = 1; */ env->PCXI |= MASK_PCXI_UL; diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 54de0dd346..aef0d9cf06 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -8379,12 +8379,12 @@ static void decode_sys_interrupts(CPUTriCoreState *env, DisasContext *ctx) /* raise EXCP_DEBUG */ break; case OPC2_32_SYS_DISABLE: - tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~MASK_ICR_IE); + tcg_gen_andi_tl(cpu_ICR, cpu_ICR, ~MASK_ICR_IE_1_3); break; case OPC2_32_SYS_DSYNC: break; case OPC2_32_SYS_ENABLE: - tcg_gen_ori_tl(cpu_ICR, cpu_ICR, MASK_ICR_IE); + tcg_gen_ori_tl(cpu_ICR, cpu_ICR, MASK_ICR_IE_1_3); break; case OPC2_32_SYS_ISYNC: break;