From patchwork Mon Feb 28 09:10:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 594871 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1S9DgQG008414 for ; Mon, 28 Feb 2011 09:13:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753003Ab1B1JNj (ORCPT ); Mon, 28 Feb 2011 04:13:39 -0500 Received: from mail-gx0-f174.google.com ([209.85.161.174]:46259 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752705Ab1B1JNj (ORCPT ); Mon, 28 Feb 2011 04:13:39 -0500 Received: by gxk8 with SMTP id 8so1439343gxk.19 for ; Mon, 28 Feb 2011 01:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references; bh=Ea1fFPtoTFxoEW0DqY2k7GqsPGd6LlGOlgzT5QQkdKw=; b=TLEMYa6fyaCnDquAtU0a6sgY0Zg0Pk/kazZqYFWloSn/DV8oAqAD9ggDWUui+0xDo2 3lc+v7ODaSx0QrVeTQAhPg8zZQPFlAJ1jU1avxeywj4Y6G257JHm6clTpYiRfntjjIpm d3s5CAkDzV8uVieVCm8OjwgbW6pJ3h0Dc7epg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=LuUPyzOEGNwnxHKoPjPia0kSbOUt6o2sG7NsbwSIGDbXaS32O1XdKoo7ZLwIALLXir 6EIC+yR8rsOjIPWYNQ+/H1LtAnNmSmcnB9rfWJINQ/I9SeU42JquFNAKYqba3dNut+9K cGqIQ6QIY3dYFCUCEubRrMYe0MNERMxjBDHCg= Received: by 10.236.5.145 with SMTP id 17mr2065700yhl.3.1298884260032; Mon, 28 Feb 2011 01:11:00 -0800 (PST) Received: from localhost.localdomain (93-34-149-100.ip50.fastwebnet.it [93.34.149.100]) by mx.google.com with ESMTPS id 1sm2037209yhl.11.2011.02.28.01.10.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Feb 2011 01:10:59 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, aurelien@aurel32.net, blauwirbel@gmail.com, jan.kiszka@siemes.com, mtosatti@redhat.com Subject: [PATCH v3 uq/master 09/22] target-sh4: move intr_at_halt out of cpu_halted() Date: Mon, 28 Feb 2011 10:10:11 +0100 Message-Id: <1298884224-19734-10-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1298884224-19734-1-git-send-email-pbonzini@redhat.com> References: <1298884224-19734-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 28 Feb 2011 09:13:42 +0000 (UTC) diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index 789d188..74ff97a 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -184,7 +184,7 @@ typedef struct CPUSH4State { uint32_t cvr; /* Cache Version Register */ void *intc_handle; - int intr_at_halt; /* SR_BL ignored during sleep */ + int in_sleep; /* SR_BL ignored during sleep */ memory_content *movcal_backup; memory_content **movcal_backup_tail; } CPUSH4State; diff --git a/target-sh4/exec.h b/target-sh4/exec.h index 2999c02..61bc121 100644 --- a/target-sh4/exec.h +++ b/target-sh4/exec.h @@ -37,7 +37,6 @@ static inline int cpu_halted(CPUState *env) { return 0; if (cpu_has_work(env)) { env->halted = 0; - env->intr_at_halt = 1; return 0; } return EXCP_HALTED; diff --git a/target-sh4/helper.c b/target-sh4/helper.c index d2038bd..8f36d31 100644 --- a/target-sh4/helper.c +++ b/target-sh4/helper.c @@ -90,11 +90,11 @@ void do_interrupt(CPUState * env) if (do_exp && env->exception_index != 0x1e0) { env->exception_index = 0x000; /* masked exception -> reset */ } - if (do_irq && !env->intr_at_halt) { + if (do_irq && !env->in_sleep) { return; /* masked */ } - env->intr_at_halt = 0; } + env->in_sleep = 0; if (do_irq) { irq_vector = sh_intc_get_pending_vector(env->intc_handle, diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c index 30f9842..b8f4ca2 100644 --- a/target-sh4/op_helper.c +++ b/target-sh4/op_helper.c @@ -119,6 +119,7 @@ void helper_debug(void) void helper_sleep(uint32_t next_pc) { env->halted = 1; + env->in_sleep = 1; env->exception_index = EXCP_HLT; env->pc = next_pc; cpu_loop_exit();