Stop including qemu-common.h in memory.h

Including qemu-common.h from other header files is generally a bad
idea, because it means it's very easy to end up with a circular
dependency. For instance, if we wanted to include memory.h from
qom/cpu.h we'd end up with this loop:
memory.h -> qemu-common.h -> cpu.h -> cpu-qom.h -> qom/cpu.h -> memory.h

Remove the include from memory.h. This requires us to fix up a few
other files which were inadvertently getting declarations indirectly
through memory.h.

The biggest change is splitting the fprintf_function typedef out
into its own header so other headers can get at it without having
to include qemu-common.h.

Backports commit fba0a593b2809ecdda68650952cf3d3332ac1990 from qemu
This commit is contained in:
Peter Maydell 2018-02-14 08:41:09 -05:00 committed by Lioncash
parent b93c24ba31
commit 2f3f2ae092
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
5 changed files with 21 additions and 4 deletions

View file

@ -11,6 +11,8 @@ struct uc_struct;
#include "qemu/bswap.h"
#include "qemu/queue.h"
#include "qemu/fprintf-fn.h"
#include "qemu/typedefs.h"
typedef enum MMUAccessType {
MMU_DATA_LOAD = 0,

View file

@ -20,7 +20,6 @@
#define DIRTY_MEMORY_NUM 1 /* num of dirty bits */
#include "unicorn/platform.h"
#include "qemu-common.h"
#include "exec/cpu-common.h"
#include "exec/hwaddr.h"
#include "exec/memattrs.h"