]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
include: Move qemu_mprotect_*() to new qemu/mprotect.h
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 8 Feb 2022 20:08:53 +0000 (20:08 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 21 Feb 2022 13:30:20 +0000 (13:30 +0000)
The qemu_mprotect_*() family of functions are used in very few files;
move them from osdep.h to a new qemu/mprotect.h.

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-3-peter.maydell@linaro.org

include/qemu/mprotect.h [new file with mode: 0644]
include/qemu/osdep.h
tcg/region.c
util/osdep.c

diff --git a/include/qemu/mprotect.h b/include/qemu/mprotect.h
new file mode 100644 (file)
index 0000000..1e83d14
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * QEMU mprotect functions
+ *
+ * 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_MPROTECT_H
+#define QEMU_MPROTECT_H
+
+int qemu_mprotect_rw(void *addr, size_t size);
+int qemu_mprotect_rwx(void *addr, size_t size);
+int qemu_mprotect_none(void *addr, size_t size);
+
+#endif
index 5ebd737aebb4f934bcbb153745ae79067a818cc1..ca00899bbd26b63b0025146a11f3684dfe74aeca 100644 (file)
@@ -496,10 +496,6 @@ void sigaction_invoke(struct sigaction *action,
                       struct qemu_signalfd_siginfo *info);
 #endif
 
-int qemu_mprotect_rw(void *addr, size_t size);
-int qemu_mprotect_rwx(void *addr, size_t size);
-int qemu_mprotect_none(void *addr, size_t size);
-
 /*
  * Don't introduce new usage of this function, prefer the following
  * qemu_open/qemu_create that take an "Error **errp"
index c46021d16046548b7820b9c0e1475d8e3b96b988..7b4e65a52e8a5793f83981e77298e5c40f7d6418 100644 (file)
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "qemu/units.h"
 #include "qemu/madvise.h"
+#include "qemu/mprotect.h"
 #include "qapi/error.h"
 #include "exec/exec-all.h"
 #include "tcg/tcg.h"
index 8c5cd6e43168b76c05463d0471f6fd1c1364798b..5181f86b82f526f6c8d0af93b4b53f4b84159218 100644 (file)
@@ -39,6 +39,7 @@ extern int madvise(char *, size_t, int);
 #include "qemu/sockets.h"
 #include "qemu/error-report.h"
 #include "qemu/madvise.h"
+#include "qemu/mprotect.h"
 #include "monitor/monitor.h"
 
 static bool fips_enabled = false;