From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3K6r-0005h8-8K for qemu-devel@nongnu.org; Mon, 30 Nov 2015 03:46:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3K6n-0003ka-TK for qemu-devel@nongnu.org; Mon, 30 Nov 2015 03:46:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3K6n-0003kV-Mm for qemu-devel@nongnu.org; Mon, 30 Nov 2015 03:46:53 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 632912653 for ; Mon, 30 Nov 2015 08:46:53 +0000 (UTC) Date: Mon, 30 Nov 2015 16:46:44 +0800 From: Peter Xu Message-ID: <20151130084641.GA28667@pxdev.xzpeter.org> References: <20151130034732.GA12255@pxdev.xzpeter.org> <87a8pvewru.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87a8pvewru.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] question: about exec/poison.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org On Mon, Nov 30, 2015 at 09:06:45AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > Hi, all, > > > > I met one problem when trying to add a new public function in dump.h > > named "dump_state_get_global" and using it in hmp.c. What I got is > > something like: > > > > In file included from /root/git/qemu/hmp.c:35:0: > > /root/git/qemu/include/sysemu/dump.h:26:34: error: attempt to use > > poisoned "TARGET_PAGE_BITS" > > (((unsigned long long)(X) >> TARGET_PAGE_BITS) - ARCH_PFN_OFFSET) > > > > I did a quick look on the poison.h file, seeing that it should be > > used to avoid using arch-depentent macros in arch-independent > > codes. That's cool. However, that's also problem to me. > > > > The problem is: First of all, dump itself is arch > > dependent. Meanwhile, hmp.c is not. Also, what I am trying to add is > > arch indepentent too (just like hmp.c). Now if I include "dump.h" in > > hmp.c to use that function, I may encounter the error message. > > > > I got one idea, which is to split dump.h into two header files: > > dump.h and dump-arch-indep.h (the latter name could be of course > > shorter). So that I can move arch independent declarations into that > > new header file and use it in hmp.h. Not sure whether this is the > > good one to go. > > > > Does anyone have suggestion on what I should do? > > What would the contents of an arch-independent dump.h be? If it's > interesting, keeping it in its own header probably makes sense. If not, > perhaps we can find an existing header to use. Can't say more than that > without seeing the actual contents. Hi, Markus, It's related to dump detach support patch set. Then I think I could first leverage an existing header and post the patch first. Thanks for the reply. Peter