]> git.proxmox.com Git - mirror_qemu.git/commitdiff
include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 8 Feb 2022 20:08:55 +0000 (20:08 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 21 Feb 2022 13:30:20 +0000 (13:30 +0000)
The qemu_icache_linesize, qemu_icache_linesize_log,
qemu_dcache_linesize, and qemu_dcache_linesize_log variables are not
used in many files.  Move them out of osdep.h to a new
qemu/cacheinfo.h, and document them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208200856.3558249-5-peter.maydell@linaro.org

accel/tcg/translate-all.c
include/qemu/cacheinfo.h [new file with mode: 0644]
include/qemu/osdep.h
plugins/loader.c
tcg/region.c
tcg/tcg.c
util/atomic64.c
util/cacheflush.c
util/cacheinfo.c

index bd71db59a9a9e0c9d3d900829b6a2a1d20a9feee..5971cd53ab9f6935fc0b99709542ac0c6bce6447 100644 (file)
@@ -51,6 +51,7 @@
 #include "qemu/qemu-print.h"
 #include "qemu/timer.h"
 #include "qemu/main-loop.h"
+#include "qemu/cacheinfo.h"
 #include "exec/log.h"
 #include "sysemu/cpus.h"
 #include "sysemu/cpu-timers.h"
diff --git a/include/qemu/cacheinfo.h b/include/qemu/cacheinfo.h
new file mode 100644 (file)
index 0000000..019a157
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * QEMU host cacheinfo information
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef QEMU_CACHEINFO_H
+#define QEMU_CACHEINFO_H
+
+/*
+ * These variables represent our best guess at the host icache and
+ * dcache sizes, expressed both as the size in bytes and as the
+ * base-2 log of the size in bytes. They are initialized at startup
+ * (via an attribute 'constructor' function).
+ */
+extern int qemu_icache_linesize;
+extern int qemu_icache_linesize_log;
+extern int qemu_dcache_linesize;
+extern int qemu_dcache_linesize_log;
+
+#endif
index 165448b12f819fcdcdd15af40db68a09b0e04fe0..61808edc69f22ba22b3b1f2bf6a5924da236ab1f 100644 (file)
@@ -616,11 +616,6 @@ pid_t qemu_fork(Error **errp);
 extern uintptr_t qemu_real_host_page_size;
 extern intptr_t qemu_real_host_page_mask;
 
-extern int qemu_icache_linesize;
-extern int qemu_icache_linesize_log;
-extern int qemu_dcache_linesize;
-extern int qemu_dcache_linesize_log;
-
 /*
  * After using getopt or getopt_long, if you need to parse another set
  * of options, then you must reset optind.  Unfortunately the way to
index a4ec28169223476c0e22932dd48390a664e8c5c6..4883b0a1cbcce037b71990ac861a6d3f9027faa0 100644 (file)
@@ -24,6 +24,7 @@
 #include "qemu/rcu_queue.h"
 #include "qemu/qht.h"
 #include "qemu/bitmap.h"
+#include "qemu/cacheinfo.h"
 #include "qemu/xxhash.h"
 #include "qemu/plugin.h"
 #include "hw/core/cpu.h"
index 7b4e65a52e8a5793f83981e77298e5c40f7d6418..72afb357389317fabdf3b553403387275ff27c80 100644 (file)
@@ -26,6 +26,7 @@
 #include "qemu/units.h"
 #include "qemu/madvise.h"
 #include "qemu/mprotect.h"
+#include "qemu/cacheinfo.h"
 #include "qapi/error.h"
 #include "exec/exec-all.h"
 #include "tcg/tcg.h"
index 5d2f0d8b1032e5b77da26f923f8228ba40a02404..528277d1d3c3423a68253a0cfe43eb93ad1e10c6 100644 (file)
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -36,6 +36,7 @@
 #include "qemu/qemu-print.h"
 #include "qemu/timer.h"
 #include "qemu/cacheflush.h"
+#include "qemu/cacheinfo.h"
 
 /* Note: the long term plan is to reduce the dependencies on the QEMU
    CPU definitions. Currently they are used for qemu_ld/st
index 93037d5b116cda0df02e445f9d9c7aa5af984bcc..22983a970f1f82bad503feb17ef9d61f60b10b8a 100644 (file)
@@ -7,6 +7,7 @@
 #include "qemu/osdep.h"
 #include "qemu/atomic.h"
 #include "qemu/thread.h"
+#include "qemu/cacheinfo.h"
 
 #ifdef CONFIG_ATOMIC64
 #error This file must only be compiled if !CONFIG_ATOMIC64
index 933355b0c99120c0edb35834a98ad36414778098..4b57186d89cd09566079cbe63fc263bb8288590a 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/cacheflush.h"
+#include "qemu/cacheinfo.h"
 #include "qemu/bitops.h"
 
 
index b182f0b6936c2324c901b28c8d66e33c189d55a8..ab1644d490f52633708873cac0dd5090aa661516 100644 (file)
@@ -9,6 +9,7 @@
 #include "qemu/osdep.h"
 #include "qemu/host-utils.h"
 #include "qemu/atomic.h"
+#include "qemu/cacheinfo.h"
 
 int qemu_icache_linesize = 0;
 int qemu_icache_linesize_log;