[PATCH 1/3] cpu-target: Include missing 'exec/memory.h' header

Philippe Mathieu-Daudé posted 3 patches 7 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Dr. David Alan Gilbert" <dave@treblig.org>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
[PATCH 1/3] cpu-target: Include missing 'exec/memory.h' header
Posted by Philippe Mathieu-Daudé 7 months ago
Include "exec/memory.h" in order to avoid:

  cpu-target.c:201:50: error: use of undeclared identifier 'TYPE_MEMORY_REGION'
      DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION,
                                                   ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 cpu-target.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cpu-target.c b/cpu-target.c
index 958d63e882..86444cc2c6 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -31,6 +31,7 @@
 #else
 #include "hw/core/sysemu-cpu-ops.h"
 #include "exec/address-spaces.h"
+#include "exec/memory.h"
 #endif
 #include "sysemu/cpus.h"
 #include "sysemu/tcg.h"
-- 
2.41.0


Re: [PATCH 1/3] cpu-target: Include missing 'exec/memory.h' header
Posted by Peter Maydell 7 months ago
On Fri, 9 Feb 2024 at 15:01, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Include "exec/memory.h" in order to avoid:
>
>   cpu-target.c:201:50: error: use of undeclared identifier 'TYPE_MEMORY_REGION'
>       DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION,
>                                                    ^

Given that we don't actually see this error, presumably
we're implicitly dragging it in via some other include?
Anyway, better to be explicit than implicit, so

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Re: [PATCH 1/3] cpu-target: Include missing 'exec/memory.h' header
Posted by Philippe Mathieu-Daudé 7 months ago
On 9/2/24 17:01, Peter Maydell wrote:
> On Fri, 9 Feb 2024 at 15:01, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> Include "exec/memory.h" in order to avoid:
>>
>>    cpu-target.c:201:50: error: use of undeclared identifier 'TYPE_MEMORY_REGION'
>>        DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION,
>>                                                     ^
> 
> Given that we don't actually see this error, presumably
> we're implicitly dragging it in via some other include?

It is pulled in by the exec/cpu-all.h header which I'm trying to
sanitize (along with others). I'll add a note about this.

> Anyway, better to be explicit than implicit, so
> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Thanks!