Hi Paolo, thanks for reviewing.
On 03/04/2014 06:19 PM, Paolo Bonzini wrote:
Hi,
in general I agree with this patch. I have a few comments, and I
suggest that you split it in multiple patches so that it's easier to
get it in when each part is ready.
I spent some time trying to reduce it. I may be wrong, but this is the
smallest patch I can get to get all targets (linuxuser vs softmmu, kvm
enable/disable) build.
diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c
index c06aabb..950f3ec 100644
--- a/hw/dma/soc_dma.c
+++ b/hw/dma/soc_dma.c
@@ -21,6 +21,11 @@
#include "qemu/timer.h"
#include "hw/arm/soc_dma.h"
+#ifndef NEED_CPU_H
+#error target-xxx/cpu.h must be included because target-specific are
required
+#endif
Not needed; include/exec/cpu-defs.h already has a similar #error.
I guess this is my personal preference.
My original idea is to emphasize that this *whole* file is
"target-specific", as "target-independent" vs "target-specific" is
important for qemu framework (everything except target-xxx, tcg backend
and hw/arch*/). Ideally all qemu framework is designed to be
target-independent, right?
In my docs/api-hierarchy.txt, I am trying my best to illustrate what are
"target-independent", and what are "target-specific".
cpu-defs.h is NOT included in this file.
The idea is the same for the rest "#ifndef NEED_CPU_H"
Why use "#ifndef NEED_CPU_H, then #error ...", is because
"target-xxx/cpu.h"
is better included for the whole file.
If "target-xxx/cpu.h" is only needed for part of the file, use
"#ifdef NEED_CPU_H, then #include "cpu.h"".
Thanks.