From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKbrw-0005eJ-6a for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:07:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKbru-0005dU-JJ for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:06:59 -0500 Received: from [199.232.76.173] (port=38883 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKbru-0005dP-GL for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:06:58 -0500 Received: from mail-bw0-f12.google.com ([209.85.218.12]:61669) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKbrt-0000Ey-Sd for qemu-devel@nongnu.org; Wed, 07 Jan 2009 12:06:58 -0500 Received: by bwz5 with SMTP id 5so16140910bwz.10 for ; Wed, 07 Jan 2009 09:06:54 -0800 (PST) Message-ID: Date: Wed, 7 Jan 2009 19:03:08 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] [PATCH]: add leon target In-Reply-To: <20090107102439.GA15209@ulanbator.act-europe.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20090107102439.GA15209@ulanbator.act-europe.fr> 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 On 1/7/09, Tristan Gingold wrote: > Hi, > > this patch adds a new target: leon which is an open source sparc v8 variant. Thanks for the patch. Is there any way to test the system, rom images etc? Any system level docs? Do you think it would be useful to port OpenBIOS to the system? > The cpu itself implements the v8 architecture so there is nothing to change. > However the devices are different and in particular the interrupt controller. > > To handle different interrupt controllers, I added a new field in > CPUSPARCState like it is done on PowerPC. I have a feeling that this should be handled some other way but I don't know how yet. CPU emulation should not know about boards. > Comments are welcome, > Tristan. Maybe the leon.c should be split, each device in a separate file. Though I guess the devices are so unique that they won't be used elsewhere. > +++ target-sparc/op_helper.c (working copy) > @@ -2995,6 +2995,21 @@ > env->pc = env->tbr; > env->npc = env->pc + 4; > env->exception_index = 0; > + > + switch (env->intctl) { > + case intctl_sun4c: > + case intctl_sun4m: > +#if !defined(CONFIG_USER_ONLY) > + cpu_check_irqs(env); > +#endif > + break; > + case intctl_leon2: > + if ((intno & ~15) == TT_EXTINT) > + leon2_intctl_ack (env, intno); This breaks linux-user compilation, the whole switch should be enclosed in #if !defined(CONFIG_USER_ONLY) #endif For extra bonus, you could implement the following: - register device reset methods - savevm/loadvm support - pic_info, irq_info support