aboutsummaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-08-12 07:23:31 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-08-16 13:31:51 +0200
commitec150c7e09071bcf51bfaa8071fe23efb6df69f7 (patch)
tree1226162aa31d0fc73ee0ed389fe3719d79ff7201 /include/exec
parentf8f2eac4e5de8ce8ef17591ee1b84904437be25b (diff)
include: Make headers more self-contained
Back in 2016, we discussed[1] rules for headers, and these were generally liked: 1. Have a carefully curated header that's included everywhere first. We got that already thanks to Peter: osdep.h. 2. Headers should normally include everything they need beyond osdep.h. If exceptions are needed for some reason, they must be documented in the header. If all that's needed from a header is typedefs, put those into qemu/typedefs.h instead of including the header. 3. Cyclic inclusion is forbidden. This patch gets include/ closer to obeying 2. It's actually extracted from my "[RFC] Baby steps towards saner headers" series[2], which demonstrates a possible path towards checking 2 automatically. It passes the RFC test there. [1] Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org> https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html [2] Message-Id: <20190711122827.18970-1-armbru@redhat.com> https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20190812052359.30071-2-armbru@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/cputlb.h3
-rw-r--r--include/exec/exec-all.h1
-rw-r--r--include/exec/ioport.h2
-rw-r--r--include/exec/memory-internal.h2
-rw-r--r--include/exec/ram_addr.h1
-rw-r--r--include/exec/softmmu-semi.h2
-rw-r--r--include/exec/tb-hash.h2
-rw-r--r--include/exec/user/thunk.h2
8 files changed, 15 insertions, 0 deletions
diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h
index 5373188be3..a62cfb28d5 100644
--- a/include/exec/cputlb.h
+++ b/include/exec/cputlb.h
@@ -16,9 +16,12 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
#ifndef CPUTLB_H
#define CPUTLB_H
+#include "exec/cpu-common.h"
+
#if !defined(CONFIG_USER_ONLY)
/* cputlb.c */
void tlb_protect_code(ram_addr_t ram_addr);
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 16034ee651..135aeaab0d 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -20,6 +20,7 @@
#ifndef EXEC_ALL_H
#define EXEC_ALL_H
+#include "cpu.h"
#include "exec/tb-context.h"
#include "sysemu/cpus.h"
diff --git a/include/exec/ioport.h b/include/exec/ioport.h
index a298b89ce1..97feb296d2 100644
--- a/include/exec/ioport.h
+++ b/include/exec/ioport.h
@@ -24,6 +24,8 @@
#ifndef IOPORT_H
#define IOPORT_H
+#include "exec/memory.h"
+
#define MAX_IOPORTS (64 * 1024)
#define IOPORTS_MASK (MAX_IOPORTS - 1)
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index d1a9dd1ec8..ef4fb92371 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -20,6 +20,8 @@
#ifndef MEMORY_INTERNAL_H
#define MEMORY_INTERNAL_H
+#include "cpu.h"
+
#ifndef CONFIG_USER_ONLY
static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
{
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index b7b2e60ff6..a327a80cfe 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -20,6 +20,7 @@
#define RAM_ADDR_H
#ifndef CONFIG_USER_ONLY
+#include "cpu.h"
#include "hw/xen/xen.h"
#include "sysemu/tcg.h"
#include "exec/ramlist.h"
diff --git a/include/exec/softmmu-semi.h b/include/exec/softmmu-semi.h
index 970837992e..fbcae88f4b 100644
--- a/include/exec/softmmu-semi.h
+++ b/include/exec/softmmu-semi.h
@@ -10,6 +10,8 @@
#ifndef SOFTMMU_SEMI_H
#define SOFTMMU_SEMI_H
+#include "cpu.h"
+
static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr)
{
uint64_t val;
diff --git a/include/exec/tb-hash.h b/include/exec/tb-hash.h
index 4f3a37d927..805235d321 100644
--- a/include/exec/tb-hash.h
+++ b/include/exec/tb-hash.h
@@ -20,6 +20,8 @@
#ifndef EXEC_TB_HASH_H
#define EXEC_TB_HASH_H
+#include "exec/cpu-defs.h"
+#include "exec/exec-all.h"
#include "qemu/xxhash.h"
#ifdef CONFIG_SOFTMMU
diff --git a/include/exec/user/thunk.h b/include/exec/user/thunk.h
index 8d3af5a3be..eae2c27f99 100644
--- a/include/exec/user/thunk.h
+++ b/include/exec/user/thunk.h
@@ -16,10 +16,12 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
#ifndef THUNK_H
#define THUNK_H
#include "cpu.h"
+#include "exec/user/abitypes.h"
/* types enums definitions */