Skip to content
Snippets Groups Projects
Commit a68d3857 authored by Anton's avatar Anton
Browse files

libtcg: Remove startaddress arg. from translate

parent b6430927
No related branches found
No related tags found
No related merge requests found
......@@ -400,7 +400,7 @@ LIBTCG_EXPORT(const char *, libtcg_get_instruction_name, (LibTcgO
LIBTCG_EXPORT(LibTcgHelperInfo, libtcg_get_helper_info, (LibTcgInstruction *insn));
LIBTCG_EXPORT(LibTcgContext *, libtcg_context_create, (LibTcgDesc *desc));
LIBTCG_EXPORT(void, libtcg_context_destroy, (LibTcgContext *context));
LIBTCG_EXPORT(LibTcgInstructionList, libtcg_translate, (LibTcgContext *context, const unsigned char *buffer, uint64_t start_address, size_t size, uint64_t virtual_address, uint32_t translate_flags));
LIBTCG_EXPORT(LibTcgInstructionList, libtcg_translate, (LibTcgContext *context, const unsigned char *buffer, size_t size, uint64_t virtual_address, uint32_t translate_flags));
LIBTCG_EXPORT(void, libtcg_instruction_list_destroy, (LibTcgContext *context, LibTcgInstructionList));
LIBTCG_EXPORT(uint8_t *, libtcg_env_ptr, (LibTcgContext *context));
LIBTCG_EXPORT(void, libtcg_dump_instruction_to_buffer, (LibTcgInstruction *insn, char *buf, size_t size));
......
......@@ -66,6 +66,7 @@ static inline void *vaddr_to_buf_ptr(CPUArchState *env, abi_ptr ptr, size_t type
CPUState *cpu = env_cpu(env);
BytecodeRegion *region = cpu->opaque;
uint64_t offset = (uintptr_t)ptr - region->virtual_address;
assert(offset + type_size <= region->size);
return (void *) ((uintptr_t) region->buffer + offset);
}
......@@ -171,7 +172,6 @@ void libtcg_context_destroy(LibTcgContext *context)
LibTcgInstructionList libtcg_translate(LibTcgContext *context,
const unsigned char *buffer,
uint64_t start_address,
size_t size,
uint64_t virtual_address,
uint32_t translate_flags)
......@@ -180,7 +180,7 @@ LibTcgInstructionList libtcg_translate(LibTcgContext *context,
BytecodeRegion region = {
.buffer = buffer,
.size = size,
.virtual_address = start_address,
.virtual_address = virtual_address,
};
context->cpu->opaque = &region;
......@@ -197,10 +197,11 @@ LibTcgInstructionList libtcg_translate(LibTcgContext *context,
/* Set flags */
#ifdef TARGET_ARM
if (translate_flags & LIBTCG_TRANSLATE_ARM_THUMB) {
CPUARMTBFlags arm_flags = {};
CPUARMTBFlags arm_flags = {flags, cs_base};
/* flags |= THUMB; */
DP_TBFLAG_AM32(arm_flags, THUMB, 1);
flags = arm_flags.flags;
cs_base = arm_flags.flags2;
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment