diff mbox series

[05/11] hw/mips/loongson3_bootp: Include missing headers

Message ID 20250112215835.29320-6-philmd@linaro.org
State Superseded
Headers show
Series hw/mips/loongson3: Remove uses of &first_cpu global | expand

Commit Message

Philippe Mathieu-Daudé Jan. 12, 2025, 9:58 p.m. UTC
MemMapEntry is declared in "exec/hwaddr.h", cpu_to_le32() in
"qemu/bswap.h". These headers are indirectly included via "cpu.h".
Include them explicitly in order to avoid when removing "cpu.h":

  In file included from ../../hw/mips/loongson3_bootp.c:27:
  hw/mips/loongson3_bootp.h:234:14: error: unknown type name 'MemMapEntry'
    234 | extern const MemMapEntry virt_memmap[];
        |              ^
  hw/mips/loongson3_bootp.c:33:18: error: call to undeclared function 'cpu_to_le32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     33 |     c->cputype = cpu_to_le32(Loongson_3A);
        |                  ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/mips/loongson3_bootp.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Henderson Jan. 15, 2025, 5:10 a.m. UTC | #1
On 1/12/25 13:58, Philippe Mathieu-Daudé wrote:
> MemMapEntry is declared in "exec/hwaddr.h", cpu_to_le32() in
> "qemu/bswap.h". These headers are indirectly included via "cpu.h".
> Include them explicitly in order to avoid when removing "cpu.h":
> 
>    In file included from ../../hw/mips/loongson3_bootp.c:27:
>    hw/mips/loongson3_bootp.h:234:14: error: unknown type name 'MemMapEntry'
>      234 | extern const MemMapEntry virt_memmap[];
>          |              ^
>    hw/mips/loongson3_bootp.c:33:18: error: call to undeclared function 'cpu_to_le32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>       33 |     c->cputype = cpu_to_le32(Loongson_3A);
>          |                  ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/mips/loongson3_bootp.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/hw/mips/loongson3_bootp.c b/hw/mips/loongson3_bootp.c
> index b97b81903b7..712439c2575 100644
> --- a/hw/mips/loongson3_bootp.c
> +++ b/hw/mips/loongson3_bootp.c
> @@ -21,6 +21,8 @@
>   #include "qemu/osdep.h"
>   #include "qemu/units.h"
>   #include "qemu/cutils.h"
> +#include "qemu/bswap.h"
> +#include "exec/hwaddr.h"
>   #include "cpu.h"
>   #include "hw/boards.h"
>   #include "hw/mips/loongson3_bootp.h"

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/hw/mips/loongson3_bootp.c b/hw/mips/loongson3_bootp.c
index b97b81903b7..712439c2575 100644
--- a/hw/mips/loongson3_bootp.c
+++ b/hw/mips/loongson3_bootp.c
@@ -21,6 +21,8 @@ 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qemu/cutils.h"
+#include "qemu/bswap.h"
+#include "exec/hwaddr.h"
 #include "cpu.h"
 #include "hw/boards.h"
 #include "hw/mips/loongson3_bootp.h"