From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuNBa-0000ZE-50 for qemu-devel@nongnu.org; Wed, 24 Mar 2010 05:47:38 -0400 Received: from [140.186.70.92] (port=44938 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuNBX-0000XE-3d for qemu-devel@nongnu.org; Wed, 24 Mar 2010 05:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuNBS-0003Lj-TR for qemu-devel@nongnu.org; Wed, 24 Mar 2010 05:47:34 -0400 Received: from qw-out-1920.google.com ([74.125.92.147]:63283) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuNBS-0003LM-Pu for qemu-devel@nongnu.org; Wed, 24 Mar 2010 05:47:30 -0400 Received: by qw-out-1920.google.com with SMTP id 5so934107qwf.4 for ; Wed, 24 Mar 2010 02:47:28 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4BA9DFAA.3070107@redhat.com> Date: Wed, 24 Mar 2010 10:47:22 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Compile files only once: some planning List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel > The harder cases are those where the device code depends somehow on > the architecture. Some thoughts follow. > > vl.c: a lot of work. Maybe the CPUState stuff should be separated to a new file. > > dma.c: DMA_schedule needs access to CPUState. Most users of CPUState (e.g. qemu-timer.c and hw/dma.c) either need it as an opaque pointer, or only need access to target-independent stuff. So you could: 1) make CPUState define only common fields. Include CPUState at the beginning of each per-target CPUXYZState. 2) Do s/CPUState/CPUXYZState/ on target-*/*. 3) Make it compile, possibly by undoing parts of 2) and changing parts of it to DO_UPCAST. Paolo