diff --git a/include/qemu.h b/include/qemu.h index f7fc3fe5..20316539 100644 --- a/include/qemu.h +++ b/include/qemu.h @@ -17,7 +17,7 @@ struct uc_struct; #include "vl.h" -// These two structs are originally from qemu/include/exec/cpu-all.h +// This struct was originally from qemu/include/exec/cpu-all.h // Temporarily moved here since there is circular inclusion. typedef struct { @@ -28,12 +28,4 @@ typedef struct { bool in_use; } BounceBuffer; -typedef struct RAMList { - /* Protected by the iothread lock. */ - unsigned long *dirty_memory[DIRTY_MEMORY_NUM]; - RAMBlock *mru_block; - QLIST_HEAD(, RAMBlock) blocks; - uint32_t version; -} RAMList; - #endif diff --git a/include/uc_priv.h b/include/uc_priv.h index 3af90228..c7f85a61 100644 --- a/include/uc_priv.h +++ b/include/uc_priv.h @@ -8,6 +8,7 @@ #include #include "qemu.h" +#include "exec/ramlist.h" #include "unicorn/unicorn.h" #include "list.h" diff --git a/qemu/include/exec/memory.h b/qemu/include/exec/memory.h index b0a6289a..6ff234ec 100644 --- a/qemu/include/exec/memory.h +++ b/qemu/include/exec/memory.h @@ -16,9 +16,6 @@ #ifndef CONFIG_USER_ONLY -#define DIRTY_MEMORY_CODE 0 -#define DIRTY_MEMORY_NUM 1 /* num of dirty bits */ - #include "unicorn/platform.h" #include "exec/cpu-common.h" #include "exec/hwaddr.h" diff --git a/qemu/include/exec/ram_addr.h b/qemu/include/exec/ram_addr.h index 8e5161cb..4a00cde4 100644 --- a/qemu/include/exec/ram_addr.h +++ b/qemu/include/exec/ram_addr.h @@ -23,6 +23,7 @@ #ifndef CONFIG_USER_ONLY #include "hw/xen/xen.h" +#include "exec/ramlist.h" struct RAMBlock { struct MemoryRegion *mr; diff --git a/qemu/include/exec/ramlist.h b/qemu/include/exec/ramlist.h new file mode 100644 index 00000000..c3d7f860 --- /dev/null +++ b/qemu/include/exec/ramlist.h @@ -0,0 +1,18 @@ +#ifndef RAMLIST_H +#define RAMLIST_H + +#include "qemu/queue.h" +#include "qemu/thread.h" + +#define DIRTY_MEMORY_CODE 0 +#define DIRTY_MEMORY_NUM 1 /* num of dirty bits */ + +typedef struct RAMList { + /* Protected by the iothread lock. */ + unsigned long *dirty_memory[DIRTY_MEMORY_NUM]; + RAMBlock *mru_block; + QLIST_HEAD(, RAMBlock) blocks; + uint32_t version; +} RAMList; + +#endif