2015-08-21 10:04:50 +03:00
|
|
|
/* By Dang Hoang Vu <dang.hvu -at- gmail.com>, 2015 */
|
2021-10-03 17:14:44 +03:00
|
|
|
/* Modified for Unicorn Engine by Chen Huitao<chenhuitao@hfmrit.com>, 2020 */
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
#ifndef UC_QEMU_H
|
|
|
|
#define UC_QEMU_H
|
|
|
|
|
|
|
|
struct uc_struct;
|
|
|
|
|
|
|
|
#define OPC_BUF_SIZE 640
|
|
|
|
|
|
|
|
#include "sysemu/sysemu.h"
|
|
|
|
#include "sysemu/cpus.h"
|
|
|
|
#include "exec/cpu-common.h"
|
|
|
|
#include "exec/memory.h"
|
|
|
|
|
|
|
|
#include "qemu/thread.h"
|
2021-10-03 17:14:44 +03:00
|
|
|
#include "hw/core/cpu.h"
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
#include "vl.h"
|
|
|
|
|
2021-10-03 17:14:44 +03:00
|
|
|
// This struct is originally from qemu/include/exec/ramblock.h
|
2015-08-21 10:04:50 +03:00
|
|
|
// Temporarily moved here since there is circular inclusion.
|
2021-10-03 17:14:44 +03:00
|
|
|
struct RAMBlock {
|
2015-08-21 10:04:50 +03:00
|
|
|
struct MemoryRegion *mr;
|
|
|
|
uint8_t *host;
|
|
|
|
ram_addr_t offset;
|
2021-10-03 17:14:44 +03:00
|
|
|
ram_addr_t used_length;
|
|
|
|
ram_addr_t max_length;
|
2015-08-21 10:04:50 +03:00
|
|
|
uint32_t flags;
|
2021-10-03 17:14:44 +03:00
|
|
|
/* RCU-enabled, writes protected by the ramlist lock */
|
|
|
|
QLIST_ENTRY(RAMBlock) next;
|
|
|
|
size_t page_size;
|
|
|
|
};
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
MemoryRegion *mr;
|
|
|
|
void *buffer;
|
|
|
|
hwaddr addr;
|
|
|
|
hwaddr len;
|
|
|
|
} BounceBuffer;
|
|
|
|
|
2021-10-03 17:14:44 +03:00
|
|
|
// This struct is originally from qemu/include/exec/ramlist.h
|
2015-08-21 10:04:50 +03:00
|
|
|
typedef struct RAMList {
|
|
|
|
RAMBlock *mru_block;
|
2021-10-03 17:14:44 +03:00
|
|
|
QLIST_HEAD(, RAMBlock) blocks;
|
2015-08-21 10:04:50 +03:00
|
|
|
} RAMList;
|
|
|
|
|
|
|
|
#endif
|