From patchwork Thu Aug 25 06:41:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peter A. G. Crosthwaite" X-Patchwork-Id: 111473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8F8FAB6F69 for ; Thu, 25 Aug 2011 16:44:42 +1000 (EST) Received: from localhost ([::1]:45424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTg2-0002Uk-H9 for incoming@patchwork.ozlabs.org; Thu, 25 Aug 2011 02:44:34 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTfx-0002UR-QB for qemu-devel@nongnu.org; Thu, 25 Aug 2011 02:44:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwTfw-00046V-Mb for qemu-devel@nongnu.org; Thu, 25 Aug 2011 02:44:29 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:34522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTfw-0003yc-K6 for qemu-devel@nongnu.org; Thu, 25 Aug 2011 02:44:28 -0400 Received: by mail-yi0-f45.google.com with SMTP id 10so1693869yih.4 for ; Wed, 24 Aug 2011 23:44:28 -0700 (PDT) Received: by 10.150.115.10 with SMTP id n10mr542055ybc.16.1314254668253; Wed, 24 Aug 2011 23:44:28 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id k17sm964889yba.14.2011.08.24.23.44.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Aug 2011 23:44:27 -0700 (PDT) From: "Peter A. G. Crosthwaite" To: qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com, edgar.iglesias@gmail.com, john.williams@petalogix.com, michal.simek@petalogix.com Date: Thu, 25 Aug 2011 16:41:19 +1000 Message-Id: <1314254480-22438-14-git-send-email-peter.crosthwaite@petalogix.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1314254480-22438-1-git-send-email-peter.crosthwaite@petalogix.com> References: <1314254480-22438-1-git-send-email-peter.crosthwaite@petalogix.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.218.45 Cc: "Edgar E. Iglesias" Subject: [Qemu-devel] [RFC PATCH V1 13/14] microblaze: Add an MSR_PVR constant and use it. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Edgar E. Iglesias Signed-off-by: Edgar E. Iglesias --- target-microblaze/cpu.h | 1 + target-microblaze/translate.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index a81da62..3530286 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -65,6 +65,7 @@ struct CPUMBState; #define MSR_DCE (1<<7) /* 0x080 */ #define MSR_EE (1<<8) /* 0x100 */ #define MSR_EIP (1<<9) /* 0x200 */ +#define MSR_PVR (1<<10) /* 0x400 */ #define MSR_CC (1<<31) /* Machine State Register (MSR) Fields */ diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 15f1fe5..366fd3e 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -429,8 +429,8 @@ static inline void msr_write(DisasContext *dc, TCGv v) t = tcg_temp_new(); dc->cpustate_changed = 1; /* PVR bit is not writable. */ - tcg_gen_andi_tl(t, v, ~(1 << 10)); - tcg_gen_andi_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], (1 << 10)); + tcg_gen_andi_tl(t, v, ~MSR_PVR); + tcg_gen_andi_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], MSR_PVR); tcg_gen_or_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], v); tcg_temp_free(t); }