mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
exec/cpu-all: Include 'cpu.h' earlier so MMU_USER_IDX is always defined
Include "cpu.h" earlier to get the MMU_USER_IDX definition soon enough and avoid when refactoring unrelated headers: In file included from include/exec/translator.h:271, from ../../accel/tcg/translator.c:13: include/exec/cpu-all.h: In function ‘cpu_mmu_index’: include/exec/cpu-all.h:274:12: error: ‘MMU_USER_IDX’ undeclared (first use in this function) 274 | return MMU_USER_IDX; | ^~~~~~~~~~~~ include/exec/cpu-all.h:274:12: note: each undeclared identifier is reported only once for each function it appears in ninja: build stopped: subcommand failed. We need to forward-declare cpu_mmu_index() to avoid on user emulation: In file included from include/exec/cpu-all.h:263, from include/exec/translator.h:271, from ../../accel/tcg/translator.c:13: ../../target/sparc/cpu.h: In function ‘cpu_get_tb_cpu_state’: ../../target/sparc/cpu.h:757:13: error: implicit declaration of function ‘cpu_mmu_index’ [-Werror=implicit-function-declaration] 757 | flags = cpu_mmu_index(env_cpu(env), false); | ^~~~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20241218155202.71931-5-philmd@linaro.org>
This commit is contained in:
parent
fc3630b2a9
commit
5c09d295e0
1 changed files with 4 additions and 1 deletions
|
@ -180,8 +180,12 @@ CPUArchState *cpu_copy(CPUArchState *env);
|
|||
| CPU_INTERRUPT_TGT_EXT_3 \
|
||||
| CPU_INTERRUPT_TGT_EXT_4)
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
#ifdef CONFIG_USER_ONLY
|
||||
|
||||
static inline int cpu_mmu_index(CPUState *cs, bool ifetch);
|
||||
|
||||
/*
|
||||
* Allow some level of source compatibility with softmmu. We do not
|
||||
* support any of the more exotic features, so only invalid pages may
|
||||
|
@ -271,7 +275,6 @@ static inline bool tlb_hit(uint64_t tlb_addr, vaddr addr)
|
|||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
/* Validate correct placement of CPUArchState. */
|
||||
#include "cpu.h"
|
||||
QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
|
||||
QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue