From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44299 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSD6x-0002Hf-6X for qemu-devel@nongnu.org; Fri, 25 Jun 2010 13:54:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OS3qg-0007cX-GC for qemu-devel@nongnu.org; Fri, 25 Jun 2010 04:01:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7541) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OS3qg-0007cB-9T for qemu-devel@nongnu.org; Fri, 25 Jun 2010 04:01:18 -0400 Message-ID: <4C246246.8030903@redhat.com> Date: Fri, 25 Jun 2010 10:01:10 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20100625030240.GJ4498@valinux.co.jp> In-Reply-To: <20100625030240.GJ4498@valinux.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v2] Makefile: poison TARGET_xxx for compile once. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: amit.shah@redhat.com, blauwirbel@gmail.com, qemu-devel@nongnu.org, rth@twiddle.net On 06/25/2010 05:02 AM, Isaku Yamahata wrote: > poison TARGET_xxx for compile once object > to prevent those ifdef from creeping in again. > > didn't poison env which is used as function argument as void *env. > Although it would be possible to sort it out, for now just not poison it. > > qemu-malloc.c didn't compile, so I make it non compile-once for now. > It is linked via block-obj-y in Makefile.obj and common-obj-y in > Makefile.objs through block-obj-y. So qemu-malloc.o is explicitly > added to rules. I'm still skeptical, not about the goal but about the means. I'm going to push again for my patch to make CPUState opaque for non-per-target files. I haven't heard good reasons against it. The main objection was that hw files would have no reason for accessing CPUState. But this makes no sense if CPUState is opaque, and on the other hand we have now a proliferation of void* arguments and fields (e.g. in qemu_cpu_kick). Which I am taught is a very bad thing. If that patch was accepted, we'd just need this to implement your proposal: diff --git a/cpu-common.h b/cpu-common.h index f325e60..78f8b12 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -11,10 +11,6 @@ #include "targphys.h" #endif -#ifndef NEED_CPU_H -#include "poison.h" -#endif - #include "bswap.h" #include "qemu-queue.h" diff --git a/qemu-common.h b/qemu-common.h index 3fb2f0b..3f92d40 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -90,15 +90,12 @@ static inline char *realpath(const char *path, char *resolved_path) /* FIXME: Remove NEED_CPU_H. */ #ifndef NEED_CPU_H - #include #include "osdep.h" #include "bswap.h" - +#include "poison.h" #else - #include "cpu.h" - #endif /* !defined(NEED_CPU_H) */ /* bottom halves */ I'll put this together in a complete patch series and post. Paolo