Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LF2vK-00082r-16 for qemu-devel@nongnu.org; Tue, 23 Dec 2008 03:47:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LF2vJ-00082f-DF for qemu-devel@nongnu.org; Tue, 23 Dec 2008 03:47:29 -0500 Received: from [199.232.76.173] (port=39993 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LF2vJ-00082c-6G for qemu-devel@nongnu.org; Tue, 23 Dec 2008 03:47:29 -0500 Received: from savannah.gnu.org ([199.232.41.3]:44951 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LF2vI-0007uR-SD for qemu-devel@nongnu.org; Tue, 23 Dec 2008 03:47:29 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LF2vI-00015z-39 for qemu-devel@nongnu.org; Tue, 23 Dec 2008 08:47:28 +0000 Received: from blueswir1 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LF2vH-00015v-OM for qemu-devel@nongnu.org; Tue, 23 Dec 2008 08:47:27 +0000 MIME-Version: 1.0 Errors-To: blueswir1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Blue Swirl Message-Id: Date: Tue, 23 Dec 2008 08:47:27 +0000 Subject: [Qemu-devel] [6122] Implement tick interrupt disable bits Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6122 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6122 Author: blueswir1 Date: 2008-12-23 08:47:26 +0000 (Tue, 23 Dec 2008) Log Message: ----------- Implement tick interrupt disable bits Modified Paths: -------------- trunk/hw/sun4u.c trunk/target-sparc/cpu.h Modified: trunk/hw/sun4u.c =================================================================== --- trunk/hw/sun4u.c 2008-12-22 21:06:23 UTC (rev 6121) +++ trunk/hw/sun4u.c 2008-12-23 08:47:26 UTC (rev 6122) @@ -57,6 +57,9 @@ #define MAX_PILS 16 +#define TICK_INT_DIS 0x8000000000000000ULL +#define TICK_MAX 0x7fffffffffffffffULL + struct hwdef { const char * const default_cpu_model; uint16_t machine_id; @@ -269,11 +272,14 @@ CPUState *env = s->env; cpu_reset(env); - ptimer_set_limit(env->tick, 0x7fffffffffffffffULL, 1); + env->tick_cmpr = TICK_INT_DIS | 0; + ptimer_set_limit(env->tick, TICK_MAX, 1); ptimer_run(env->tick, 0); - ptimer_set_limit(env->stick, 0x7fffffffffffffffULL, 1); + env->stick_cmpr = TICK_INT_DIS | 0; + ptimer_set_limit(env->stick, TICK_MAX, 1); ptimer_run(env->stick, 0); - ptimer_set_limit(env->hstick, 0x7fffffffffffffffULL, 1); + env->hstick_cmpr = TICK_INT_DIS | 0; + ptimer_set_limit(env->hstick, TICK_MAX, 1); ptimer_run(env->hstick, 0); env->gregs[1] = 0; // Memory start env->gregs[2] = ram_size; // Memory size @@ -286,24 +292,29 @@ { CPUState *env = opaque; - env->softint |= SOFTINT_TIMER; - cpu_interrupt(env, CPU_INTERRUPT_TIMER); + if (!(env->tick_cmpr & TICK_INT_DIS)) { + env->softint |= SOFTINT_TIMER; + cpu_interrupt(env, CPU_INTERRUPT_TIMER); + } } static void stick_irq(void *opaque) { CPUState *env = opaque; - env->softint |= SOFTINT_TIMER; - cpu_interrupt(env, CPU_INTERRUPT_TIMER); + if (!(env->stick_cmpr & TICK_INT_DIS)) { + env->softint |= SOFTINT_STIMER; + cpu_interrupt(env, CPU_INTERRUPT_TIMER); + } } static void hstick_irq(void *opaque) { CPUState *env = opaque; - env->softint |= SOFTINT_TIMER; - cpu_interrupt(env, CPU_INTERRUPT_TIMER); + if (!(env->hstick_cmpr & TICK_INT_DIS)) { + cpu_interrupt(env, CPU_INTERRUPT_TIMER); + } } void cpu_tick_set_count(void *opaque, uint64_t count) Modified: trunk/target-sparc/cpu.h =================================================================== --- trunk/target-sparc/cpu.h 2008-12-22 21:06:23 UTC (rev 6121) +++ trunk/target-sparc/cpu.h 2008-12-23 08:47:26 UTC (rev 6122) @@ -330,7 +330,8 @@ uint64_t hpstate, htstate[MAXTL_MAX], hintp, htba, hver, hstick_cmpr, ssr; void *hstick; // UA 2005 uint32_t softint; -#define SOFTINT_TIMER 1 +#define SOFTINT_TIMER 1 +#define SOFTINT_STIMER (1 << 16) #endif sparc_def_t *def; } CPUSPARCState;