From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Claudio Fontana" <cfontana@suse.de>,
"Laurent Vivier" <laurent@vivier.eu>
Subject: [PATCH 08/11] exec: Restrict ioport.h to sysemu/
Date: Mon, 17 May 2021 13:11:08 +0200 [thread overview]
Message-ID: <20210517111111.1068153-9-f4bug@amsat.org> (raw)
In-Reply-To: <20210517111111.1068153-1-f4bug@amsat.org>
To make it clearer the ioport.h header is sysemu specific,
move it to the sysemu/ directory.
Patch created mechanically using:
$ sed -i s,exec/ioport.h,sysemu/ioport.h, $(git grep -l exec/ioport.h)
Then the #ifdef'ry conditional on CONFIG_USER_ONLY has
been replaced by an #error.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/display/vga_int.h | 2 +-
include/hw/dma/i8257.h | 2 +-
include/hw/isa/isa.h | 2 +-
include/{exec => sysemu}/ioport.h | 10 ++++++----
softmmu/ioport.c | 2 +-
softmmu/physmem.c | 2 +-
softmmu/qtest.c | 2 +-
target/i386/nvmm/nvmm-all.c | 2 +-
target/i386/whpx/whpx-all.c | 2 +-
MAINTAINERS | 2 +-
10 files changed, 15 insertions(+), 13 deletions(-)
rename include/{exec => sysemu}/ioport.h (93%)
diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h
index b923633cc4f..8db43e898a3 100644
--- a/hw/display/vga_int.h
+++ b/hw/display/vga_int.h
@@ -25,7 +25,7 @@
#ifndef HW_VGA_INT_H
#define HW_VGA_INT_H
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "exec/sysemu/memory.h"
#include "ui/console.h"
diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h
index f652345d65a..e987a22fdd8 100644
--- a/include/hw/dma/i8257.h
+++ b/include/hw/dma/i8257.h
@@ -2,7 +2,7 @@
#define HW_I8257_H
#include "hw/isa/isa.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "qom/object.h"
#define TYPE_I8257 "i8257"
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 9c9aabfc3b0..a63f1841111 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -4,7 +4,7 @@
/* ISA bus */
#include "exec/sysemu/memory.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "hw/qdev-core.h"
#include "qom/object.h"
diff --git a/include/exec/ioport.h b/include/sysemu/ioport.h
similarity index 93%
rename from include/exec/ioport.h
rename to include/sysemu/ioport.h
index f94f71b19f0..b37c54ce4e5 100644
--- a/include/exec/ioport.h
+++ b/include/sysemu/ioport.h
@@ -21,8 +21,12 @@
* IO ports API
*/
-#ifndef IOPORT_H
-#define IOPORT_H
+#ifndef SYSEMU_IOPORT_H
+#define SYSEMU_IOPORT_H
+
+#ifdef CONFIG_USER_ONLY
+#error Cannot include sysemu specific header from user emulation
+#endif
#include "exec/sysemu/memory.h"
@@ -40,9 +44,7 @@ typedef struct MemoryRegionPortio {
#define PORTIO_END_OF_LIST() { }
-#ifndef CONFIG_USER_ONLY
extern const MemoryRegionOps unassigned_io_ops;
-#endif
typedef struct PortioList {
const struct MemoryRegionPortio *ports;
diff --git a/softmmu/ioport.c b/softmmu/ioport.c
index 6f297027cfe..5fabbb1832a 100644
--- a/softmmu/ioport.c
+++ b/softmmu/ioport.c
@@ -26,7 +26,7 @@
*/
#include "qemu/osdep.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "exec/sysemu/memory.h"
#include "exec/sysemu/address-spaces.h"
#include "trace.h"
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 31e490185f3..51f05eb989c 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -42,7 +42,7 @@
#include "qemu/error-report.h"
#include "qemu/qemu-print.h"
#include "exec/sysemu/memory.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "sysemu/dma.h"
#include "sysemu/hostmem.h"
#include "sysemu/hw_accel.h"
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index 2551296c727..5faf99fca13 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -17,7 +17,7 @@
#include "sysemu/qtest.h"
#include "sysemu/runstate.h"
#include "chardev/char-fe.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "exec/sysemu/memory.h"
#include "hw/irq.h"
#include "qemu/accel.h"
diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c
index 8adbfcb82d9..181e7378b41 100644
--- a/target/i386/nvmm/nvmm-all.c
+++ b/target/i386/nvmm/nvmm-all.c
@@ -10,7 +10,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/sysemu/address-spaces.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "qemu-common.h"
#include "qemu/accel.h"
#include "sysemu/nvmm.h"
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index 7abc77d1c1f..c7aafa4140b 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -11,7 +11,7 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include "exec/sysemu/address-spaces.h"
-#include "exec/ioport.h"
+#include "sysemu/ioport.h"
#include "qemu-common.h"
#include "qemu/accel.h"
#include "sysemu/whpx.h"
diff --git a/MAINTAINERS b/MAINTAINERS
index 48ae2145513..ca8d0feb2bd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2398,7 +2398,7 @@ F: tests/tcg/multiarch/gdbstub/
Memory API
M: Paolo Bonzini <pbonzini@redhat.com>
S: Supported
-F: include/exec/ioport.h
+F: include/sysemu/ioport.h
F: include/exec/memop.h
F: include/exec/sysemu/memory.h
F: include/exec/ram_addr.h
--
2.26.3
next prev parent reply other threads:[~2021-05-17 11:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 11:11 [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu) Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 01/11] NOTFORMERGE target/arm: Restrict KVM files to softmmu Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 02/11] exec: Restrict hwaddr.h to sysemu/ Philippe Mathieu-Daudé
2021-05-26 18:15 ` Richard Henderson
2022-12-06 14:32 ` Philippe Mathieu-Daudé
2022-12-06 14:40 ` Philippe Mathieu-Daudé
2022-12-06 14:53 ` Claudio Fontana
2022-12-06 15:38 ` Claudio Fontana
2022-12-06 17:09 ` Philippe Mathieu-Daudé
2022-12-06 17:17 ` Richard Henderson
2022-12-07 10:09 ` Claudio Fontana
2022-12-06 15:01 ` Peter Maydell
2021-05-17 11:11 ` [PATCH 03/11] exec: Restrict cputlb.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 04/11] exec: Restrict memory.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 05/11] exec: Restrict memory-internal.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 06/11] exec: Restrict address-spaces.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 07/11] exec: Extract CPU I/O instructions to "cpu-io.h" Philippe Mathieu-Daudé
2021-05-17 11:11 ` Philippe Mathieu-Daudé [this message]
2021-05-17 11:11 ` [PATCH 09/11] exec: Restrict ram_addr.h to sysemu/ Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 10/11] exec: Restrict ramblock.h " Philippe Mathieu-Daudé
2021-05-17 11:11 ` [PATCH 11/11] exec: Restrict confidential-guest-support.h " Philippe Mathieu-Daudé
2021-05-25 14:13 ` [PATCH 00/11] exec: Restrict various system emulation specific headers (to sysemu) Philippe Mathieu-Daudé
2021-11-06 14:58 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210517111111.1068153-9-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=cfontana@suse.de \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).