From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>
Subject: [Qemu-devel] question: about exec/poison.h
Date: Mon, 30 Nov 2015 11:47:34 +0800 [thread overview]
Message-ID: <20151130034732.GA12255@pxdev.xzpeter.org> (raw)
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?
Thanks in advance!
Peter
next reply other threads:[~2015-11-30 3:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 3:47 Peter Xu [this message]
2015-11-30 8:06 ` [Qemu-devel] question: about exec/poison.h Markus Armbruster
2015-11-30 8:46 ` Peter Xu
2015-11-30 9:12 ` Paolo Bonzini
2015-11-30 9:28 ` Markus Armbruster
2015-11-30 9:48 ` Peter Xu
2015-11-30 9:47 ` Peter Xu
2015-11-30 10:36 ` Paolo Bonzini
2015-11-30 10:45 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151130034732.GA12255@pxdev.xzpeter.org \
--to=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).