1 /* By Dang Hoang Vu <dang.hvu -at- gmail.com>, 2015 */
2 
3 #ifndef UC_QEMU_H
4 #define UC_QEMU_H
5 
6 struct uc_struct;
7 
8 #define OPC_BUF_SIZE 640
9 
10 #include "sysemu/sysemu.h"
11 #include "sysemu/cpus.h"
12 #include "exec/cpu-common.h"
13 #include "exec/memory.h"
14 
15 #include "qemu/thread.h"
16 #include "include/qom/cpu.h"
17 
18 #include "vl.h"
19 
20 // This two struct is originally from qemu/include/exec/cpu-all.h
21 // Temporarily moved here since there is circular inclusion.
22 typedef struct RAMBlock {
23     struct MemoryRegion *mr;
24     uint8_t *host;
25     ram_addr_t offset;
26     ram_addr_t length;
27     uint32_t flags;
28     char idstr[256];
29     /* Reads can take either the iothread or the ramlist lock.
30      * Writes must take both locks.
31      */
32     QTAILQ_ENTRY(RAMBlock) next;
33     int fd;
34 } RAMBlock;
35 
36 typedef struct {
37     MemoryRegion *mr;
38     void *buffer;
39     hwaddr addr;
40     hwaddr len;
41 } BounceBuffer;
42 
43 typedef struct RAMList {
44     /* Protected by the iothread lock.  */
45     unsigned long *dirty_memory[DIRTY_MEMORY_NUM];
46     RAMBlock *mru_block;
47     QTAILQ_HEAD(, RAMBlock) blocks;
48     uint32_t version;
49 } RAMList;
50 
51 #endif
52