Il 04/03/2014 13:02, Xuebing wang ha scritto:
Of these, vl.c and linux-user/elfload.c should not include
disas/disas.h at all, and hw/core/loader.c is !NEED_CPU_H. So there
are just two files where you can add a #include "cpu.h" manually.
My idea is to keep disas/disas.h correct just by itself, regardless how
it's used by *.c files.
In general, it's a good idea to make headers self-contained by
recursively including whatever's necessary.
However, there are a few very central headers that are just too
complicated to make self-consistent without introducing circular references.
In particular, for QEMU these are qemu-common.h and cpu.h (and also
others, such as exec-all.h but perhaps the solution there is to split
them). It's much simpler to ask people to include these two files in
the C files.
Paolo