[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/26] include: Move qemu_mprotect_*() to new qemu/mprotect.h
From: |
Peter Maydell |
Subject: |
[PULL 17/26] include: Move qemu_mprotect_*() to new qemu/mprotect.h |
Date: |
Mon, 21 Feb 2022 09:27:51 +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 | 14 ++++++++++++++
include/qemu/osdep.h | 4 ----
tcg/region.c | 1 +
util/osdep.c | 1 +
4 files changed, 16 insertions(+), 4 deletions(-)
create mode 100644 include/qemu/mprotect.h
diff --git a/include/qemu/mprotect.h b/include/qemu/mprotect.h
new file mode 100644
index 00000000000..1e83d1433ee
--- /dev/null
+++ b/include/qemu/mprotect.h
@@ -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
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 5ebd737aebb..ca00899bbd2 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -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"
diff --git a/tcg/region.c b/tcg/region.c
index c46021d1604..7b4e65a52e8 100644
--- a/tcg/region.c
+++ b/tcg/region.c
@@ -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"
diff --git a/util/osdep.c b/util/osdep.c
index 8c5cd6e4316..5181f86b82f 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -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;
--
2.25.1
- [PULL 08/26] target/arm: Use aarch64_cpu_register() for 'host' CPU type, (continued)
- [PULL 08/26] target/arm: Use aarch64_cpu_register() for 'host' CPU type, Peter Maydell, 2022/02/21
- [PULL 12/26] target/arm: Support PAuth extension for hvf, Peter Maydell, 2022/02/21
- [PULL 05/26] Mark remaining global TypeInfo instances as const, Peter Maydell, 2022/02/21
- [PULL 09/26] target/arm: Make KVM -cpu max exactly like -cpu host, Peter Maydell, 2022/02/21
- [PULL 11/26] target/arm: Fix '-cpu max' for HVF, Peter Maydell, 2022/02/21
- [PULL 14/26] Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus, Peter Maydell, 2022/02/21
- [PULL 13/26] Kconfig: Add I2C_DEVICES device group, Peter Maydell, 2022/02/21
- [PULL 10/26] target/arm: Unindent unnecessary else-clause, Peter Maydell, 2022/02/21
- [PULL 15/26] hw/arm/armv7m: Handle disconnected clock inputs, Peter Maydell, 2022/02/21
- [PULL 16/26] include: Move qemu_madvise() and related #defines to new qemu/madvise.h, Peter Maydell, 2022/02/21
- [PULL 17/26] include: Move qemu_mprotect_*() to new qemu/mprotect.h,
Peter Maydell <=
- [PULL 19/26] include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h, Peter Maydell, 2022/02/21
- [PULL 20/26] include: Move hardware version declarations to new qemu/hw-version.h, Peter Maydell, 2022/02/21
- [PULL 23/26] hw/arm: add initial mori-bmc board, Peter Maydell, 2022/02/21
- [PULL 18/26] include: Move QEMU_MAP_* constants to mmap-alloc.h, Peter Maydell, 2022/02/21
- [PULL 26/26] ui/cocoa: Fix the leak of qemu_console_get_label, Peter Maydell, 2022/02/21
- [PULL 21/26] MAINTAINERS: Add Akihiko Odaki to macOS-relateds, Peter Maydell, 2022/02/21
- [PULL 25/26] ui/cocoa: Do not alert even without block devices, Peter Maydell, 2022/02/21
- [PULL 24/26] ui/cocoa: Remove allowedFileTypes restriction in SavePanel, Peter Maydell, 2022/02/21
- [PULL 22/26] hw/timer: fix a9gtimer vmstate, Peter Maydell, 2022/02/21