target: Include missing 'cpu.h'
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Mon, 7 Feb 2022 11:44:46 +0000 (12:44 +0100)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Sun, 6 Mar 2022 12:15:42 +0000 (13:15 +0100)
These target-specific files use the target-specific CPU state
but lack to include "cpu.h"; i.e.:

    ../target/riscv/pmp.h:61:23: error: unknown type name 'CPURISCVState'
    void pmpcfg_csr_write(CPURISCVState *env, uint32_t reg_index,
                          ^
    ../target/nios2/mmu.h:43:18: error: unknown type name 'CPUNios2State'
    void mmu_flip_um(CPUNios2State *env, unsigned int um);
                     ^
    ../target/microblaze/mmu.h:88:19: error: unknown type name 'CPUMBState'; did you mean 'CPUState'?
    uint32_t mmu_read(CPUMBState *env, bool ea, uint32_t rn);
                      ^~~~~~~~~~
                      CPUState

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220214183144.27402-10-f4bug@amsat.org>

target/microblaze/mmu.h
target/mips/internal.h
target/nios2/mmu.h
target/riscv/pmp.h

index b6b4b9ad603587c5583c770f7a5daea98f107924..1068bd2d52b774aa6f226311340a83e542787e30 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef TARGET_MICROBLAZE_MMU_H
 #define TARGET_MICROBLAZE_MMU_H
 
+#include "cpu.h"
+
 #define MMU_R_PID    0
 #define MMU_R_ZPR    1
 #define MMU_R_TLBX   2
index daddb05fd43de44e2c1cfcf874ef03beefd1d848..f705d6bfa6136c01ceafbb617abd6247ff7e9930 100644 (file)
@@ -12,6 +12,7 @@
 #ifdef CONFIG_TCG
 #include "tcg/tcg-internal.h"
 #endif
+#include "cpu.h"
 
 /*
  * MMU types, the first four entries have the same layout as the
index b7785b46c019815cbb36d88dae5144eabdb13826..5b085900fbf9a0729967ae4832fad89b7da85cef 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef NIOS2_MMU_H
 #define NIOS2_MMU_H
 
+#include "cpu.h"
+
 typedef struct Nios2TLBEntry {
     target_ulong tag;
     target_ulong data;
index a9a0b363a77843ccfc96b92f739efca729d31fe8..fcb6b7c46772640320578fbe0ef76a1d8699c038 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef RISCV_PMP_H
 #define RISCV_PMP_H
 
+#include "cpu.h"
+
 typedef enum {
     PMP_READ  = 1 << 0,
     PMP_WRITE = 1 << 1,