From patchwork Tue Apr 23 15:45:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 238944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DE1EB2C00E4 for ; Wed, 24 Apr 2013 01:46:27 +1000 (EST) Received: from localhost ([::1]:38847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUfQI-0004PS-7F for incoming@patchwork.ozlabs.org; Tue, 23 Apr 2013 11:46:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUfQ0-0004NT-Uu for qemu-devel@nongnu.org; Tue, 23 Apr 2013 11:46:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUfPz-0002Ep-Ea for qemu-devel@nongnu.org; Tue, 23 Apr 2013 11:46:08 -0400 Received: from mail-ee0-f50.google.com ([74.125.83.50]:47444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUfPz-0002ER-7i for qemu-devel@nongnu.org; Tue, 23 Apr 2013 11:46:07 -0400 Received: by mail-ee0-f50.google.com with SMTP id e53so343887eek.23 for ; Tue, 23 Apr 2013 08:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer; bh=K09rOnyTdjsPphQhVlnnMh1394RtJE94jrBjWT0mkUc=; b=yeR+P2Xwjn6onsQ/V8cJm7L9gOpBVHosPSqdkrH4tuMUzXs8jH6etxwhcCK+VMCeBy apFWzWnSvPMlVQ5rbf7wkZ9TVTFf1e5a+rTMkUlz5CBFlTwlt0Y5o3WnmYQVcGpLHn1N Bd3chJ0OKZcx3mXS6Y97Z9om/n6aSkwAuJq3hWXC6plQ99tJqrOLqV3QRkQ258FVI0QJ i4LMcAW/1AUFY8jexFwkO86fCkJoVOTBoxq3X2H+PvdDblxsbB+wT5hqu7wCHNMLCIzK MMqJC37ekOYRWHMkL5GwEU9OTJ3RuK8zIJDmk7QP0BNwMdRw6+X/kpo1qlrojGMi+FiR BDmw== X-Received: by 10.15.35.200 with SMTP id g48mr38309449eev.33.1366731965781; Tue, 23 Apr 2013 08:46:05 -0700 (PDT) Received: from localhost (h59ec325f.selukar.dyn.perspektivbredband.net. [89.236.50.95]) by mx.google.com with ESMTPS id n48sm47717831eeg.12.2013.04.23.08.46.05 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 23 Apr 2013 08:46:05 -0700 (PDT) From: edgar.iglesias@gmail.com To: qemu-devel@nongnu.org Date: Tue, 23 Apr 2013 17:45:35 +0200 Message-Id: <1366731935-32501-1-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.83.50 Subject: [Qemu-devel] [PATCH] microblaze: Add internal base vectors reg 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" Configurable at CPU synthesis/instantiation. Signed-off-by: Edgar E. Iglesias --- target-microblaze/cpu.h | 1 + target-microblaze/helper.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index 1813939..dc07595 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -235,6 +235,7 @@ struct CPUMBState { uint32_t btaken; uint32_t btarget; uint32_t bimm; + uint32_t base_vectors; uint32_t imm; uint32_t regs[33]; diff --git a/target-microblaze/helper.c b/target-microblaze/helper.c index a0416d0..4246ce8 100644 --- a/target-microblaze/helper.c +++ b/target-microblaze/helper.c @@ -152,7 +152,7 @@ void mb_cpu_do_interrupt(CPUState *cs) env->sregs[SR_ESR], env->iflags); log_cpu_state_mask(CPU_LOG_INT, env, 0); env->iflags &= ~(IMM_FLAG | D_FLAG); - env->sregs[SR_PC] = 0x20; + env->sregs[SR_PC] = env->base_vectors + 0x20; break; case EXCP_MMU: @@ -192,7 +192,7 @@ void mb_cpu_do_interrupt(CPUState *cs) env->sregs[SR_PC], env->sregs[SR_EAR], env->iflags); log_cpu_state_mask(CPU_LOG_INT, env, 0); env->iflags &= ~(IMM_FLAG | D_FLAG); - env->sregs[SR_PC] = 0x20; + env->sregs[SR_PC] = env->base_vectors + 0x20; break; case EXCP_IRQ: @@ -233,7 +233,7 @@ void mb_cpu_do_interrupt(CPUState *cs) env->sregs[SR_MSR] |= t; env->regs[14] = env->sregs[SR_PC]; - env->sregs[SR_PC] = 0x10; + env->sregs[SR_PC] = env->base_vectors + 0x10; //log_cpu_state_mask(CPU_LOG_INT, env, 0); break; @@ -252,7 +252,7 @@ void mb_cpu_do_interrupt(CPUState *cs) if (env->exception_index == EXCP_HW_BREAK) { env->regs[16] = env->sregs[SR_PC]; env->sregs[SR_MSR] |= MSR_BIP; - env->sregs[SR_PC] = 0x18; + env->sregs[SR_PC] = env->base_vectors + 0x18; } else env->sregs[SR_PC] = env->btarget; break;