Ver código fonte

accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4)

Move declarations related to page protection under user
emulation from "exec/cpu-all.h" to "user/page-protection.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241212185341.2857-12-philmd@linaro.org>
Philippe Mathieu-Daudé 8 meses atrás
pai
commit
970ae60e9b

+ 1 - 0
bsd-user/main.c

@@ -38,6 +38,7 @@
 #include "qemu/plugin.h"
 #include "qemu/plugin.h"
 #include "exec/exec-all.h"
 #include "exec/exec-all.h"
 #include "user/guest-base.h"
 #include "user/guest-base.h"
+#include "user/page-protection.h"
 #include "tcg/startup.h"
 #include "tcg/startup.h"
 #include "qemu/timer.h"
 #include "qemu/timer.h"
 #include "qemu/envlist.h"
 #include "qemu/envlist.h"

+ 1 - 0
bsd-user/mmap.c

@@ -18,6 +18,7 @@
  */
  */
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "exec/page-protection.h"
 #include "exec/page-protection.h"
+#include "user/page-protection.h"
 
 
 #include "qemu.h"
 #include "qemu.h"
 
 

+ 0 - 5
include/exec/cpu-all.h

@@ -127,11 +127,6 @@ extern const TargetPageBits target_page;
 #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE)
 #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE)
 
 
 #if defined(CONFIG_USER_ONLY)
 #if defined(CONFIG_USER_ONLY)
-void page_dump(FILE *f);
-
-typedef int (*walk_memory_regions_fn)(void *, target_ulong,
-                                      target_ulong, unsigned long);
-int walk_memory_regions(void *, walk_memory_regions_fn);
 
 
 int page_get_flags(target_ulong address);
 int page_get_flags(target_ulong address);
 
 

+ 8 - 0
include/user/page-protection.h

@@ -12,9 +12,17 @@
 #error Cannot include this header from system emulation
 #error Cannot include this header from system emulation
 #endif
 #endif
 
 
+#include "cpu-param.h"
+#include "exec/target_long.h"
 #include "exec/translation-block.h"
 #include "exec/translation-block.h"
 
 
 void page_protect(tb_page_addr_t page_addr);
 void page_protect(tb_page_addr_t page_addr);
 int page_unprotect(tb_page_addr_t address, uintptr_t pc);
 int page_unprotect(tb_page_addr_t address, uintptr_t pc);
+typedef int (*walk_memory_regions_fn)(void *, target_ulong,
+                                      target_ulong, unsigned long);
+
+int walk_memory_regions(void *, walk_memory_regions_fn);
+
+void page_dump(FILE *f);
 
 
 #endif
 #endif

+ 1 - 0
linux-user/main.c

@@ -39,6 +39,7 @@
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "qemu/plugin.h"
 #include "qemu/plugin.h"
 #include "user/guest-base.h"
 #include "user/guest-base.h"
+#include "user/page-protection.h"
 #include "exec/exec-all.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
 #include "exec/gdbstub.h"
 #include "gdbstub/user.h"
 #include "gdbstub/user.h"

+ 1 - 0
linux-user/mmap.c

@@ -22,6 +22,7 @@
 #include "exec/log.h"
 #include "exec/log.h"
 #include "exec/page-protection.h"
 #include "exec/page-protection.h"
 #include "qemu.h"
 #include "qemu.h"
+#include "user/page-protection.h"
 #include "user-internals.h"
 #include "user-internals.h"
 #include "user-mmap.h"
 #include "user-mmap.h"
 #include "target_mman.h"
 #include "target_mman.h"

+ 1 - 0
linux-user/syscall.c

@@ -135,6 +135,7 @@
 #include "signal-common.h"
 #include "signal-common.h"
 #include "loader.h"
 #include "loader.h"
 #include "user-mmap.h"
 #include "user-mmap.h"
+#include "user/page-protection.h"
 #include "user/safe-syscall.h"
 #include "user/safe-syscall.h"
 #include "qemu/guest-random.h"
 #include "qemu/guest-random.h"
 #include "qemu/selfmap.h"
 #include "qemu/selfmap.h"