bb_to_IR.h. */
extern
DisResult disInstr_AMD64 ( IRSB* irbb,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
Long dis_ESC_NONE (
/*MB_OUT*/DisResult* dres,
/*MB_OUT*/Bool* expect_CAS,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
&& vex_control.guest_chase_cond
&& (Addr64)d64 != (Addr64)guest_RIP_bbstart
&& jmpDelta < 0
- && resteerOkFn( callback_opaque, d64) ) {
+ && resteerOkFn( callback_opaque, (Addr64)d64) ) {
/* Speculation: assume this backward branch is taken. So we
need to emit a side-exit to the insn following this one,
on the negation of the condition, and continue at the
if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
d64 = (guest_RIP_bbstart+delta+sz) + getSDisp(sz,delta);
delta += sz;
- if (resteerOkFn(callback_opaque,d64)) {
+ if (resteerOkFn(callback_opaque, (Addr64)d64)) {
dres->whatNext = Dis_ResteerU;
dres->continueAt = d64;
} else {
if (haveF2(pfx)) DIP("bnd ; "); /* MPX bnd prefix. */
d64 = (guest_RIP_bbstart+delta+1) + getSDisp8(delta);
delta++;
- if (resteerOkFn(callback_opaque,d64)) {
+ if (resteerOkFn(callback_opaque, (Addr64)d64)) {
dres->whatNext = Dis_ResteerU;
dres->continueAt = d64;
} else {
Long dis_ESC_0F (
/*MB_OUT*/DisResult* dres,
/*MB_OUT*/Bool* expect_CAS,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
&& vex_control.guest_chase_cond
&& (Addr64)d64 != (Addr64)guest_RIP_bbstart
&& jmpDelta < 0
- && resteerOkFn( callback_opaque, d64) ) {
+ && resteerOkFn( callback_opaque, (Addr64)d64) ) {
/* Speculation: assume this backward branch is taken. So
we need to emit a side-exit to the insn following this
one, on the negation of the condition, and continue at
static
Long dis_ESC_0F38 (
/*MB_OUT*/DisResult* dres,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
static
Long dis_ESC_0F3A (
/*MB_OUT*/DisResult* dres,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
Long dis_ESC_0F__VEX (
/*MB_OUT*/DisResult* dres,
/*OUT*/ Bool* uses_vvvv,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
Long dis_ESC_0F38__VEX (
/*MB_OUT*/DisResult* dres,
/*OUT*/ Bool* uses_vvvv,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
Long dis_ESC_0F3A__VEX (
/*MB_OUT*/DisResult* dres,
/*OUT*/ Bool* uses_vvvv,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const VexArchInfo* archinfo,
static
DisResult disInstr_AMD64_WRK (
/*OUT*/Bool* expect_CAS,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
Long delta64,
is located in host memory at &guest_code[delta]. */
DisResult disInstr_AMD64 ( IRSB* irsb_IN,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
bb_to_IR.h. */
extern
DisResult disInstr_ARM64 ( IRSB* irbb,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
static
Bool disInstr_ARM64_WRK (
/*MB_OUT*/DisResult* dres,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_instr,
is located in host memory at &guest_code[delta]. */
DisResult disInstr_ARM64 ( IRSB* irsb_IN,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
bb_to_IR.h. */
extern
DisResult disInstr_ARM ( IRSB* irbb,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
static
DisResult disInstr_ARM_WRK (
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_instr,
if (condT == IRTemp_INVALID) {
/* unconditional transfer to 'dst'. See if we can simply
continue tracing at the destination. */
- if (resteerOkFn( callback_opaque, (Addr64)dst )) {
+ if (resteerOkFn( callback_opaque, dst )) {
/* yes */
dres.whatNext = Dis_ResteerU;
dres.continueAt = (Addr64)dst;
&& resteerCisOk
&& vex_control.guest_chase_cond
&& dst < guest_R15_curr_instr_notENC
- && resteerOkFn( callback_opaque, (Addr64)(Addr32)dst) ) {
+ && resteerOkFn( callback_opaque, dst) ) {
/* Speculation: assume this backward branch is taken. So
we need to emit a side-exit to the insn following this
one, on the negation of the condition, and continue at
&& vex_control.guest_chase_cond
&& dst >= guest_R15_curr_instr_notENC
&& resteerOkFn( callback_opaque,
- (Addr64)(Addr32)
- (guest_R15_curr_instr_notENC+4)) ) {
+ guest_R15_curr_instr_notENC+4) ) {
/* Speculation: assume this forward branch is not taken.
So we need to emit a side-exit to dst (the dest) and
continue disassembling at the insn immediately
static
DisResult disInstr_THUMB_WRK (
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_instr,
is located in host memory at &guest_code[delta]. */
DisResult disInstr_ARM ( IRSB* irsb_IN,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
static ULong genericg_compute_checksum_8al_12 ( HWord first_w64 );
/* Small helpers */
-static Bool const_False ( void* callback_opaque, Addr64 a ) {
+static Bool const_False ( void* callback_opaque, Addr a ) {
return False;
}
/*IN*/ DisOneInstrFn dis_instr_fn,
/*IN*/ const UChar* guest_code,
/*IN*/ Addr64 guest_IP_bbstart,
- /*IN*/ Bool (*chase_into_ok)(void*,Addr64),
+ /*IN*/ Bool (*chase_into_ok)(void*,Addr),
/*IN*/ VexEndness host_endness,
/*IN*/ Bool sigill_diag,
/*IN*/ VexArch arch_guest,
IRConst* guest_IP_bbstart_IRConst = NULL;
Int n_cond_resteers_allowed = 2;
- Bool (*resteerOKfn)(void*,Addr64) = NULL;
+ Bool (*resteerOKfn)(void*,Addr) = NULL;
debug_print = toBool(vex_traceflags & VEX_TRACE_FE);
/* Return True iff resteering to the given addr is allowed (for
branches/calls to destinations that are known at JIT-time) */
- /*IN*/ Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ /*IN*/ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
/* Should we speculatively resteer across conditional branches?
(Experimental and not enabled by default). The strategy is
/*IN*/ DisOneInstrFn dis_instr_fn,
/*IN*/ const UChar* guest_code,
/*IN*/ Addr64 guest_IP_bbstart,
- /*IN*/ Bool (*chase_into_ok)(void*,Addr64),
+ /*IN*/ Bool (*chase_into_ok)(void*,Addr),
/*IN*/ VexEndness host_endness,
/*IN*/ Bool sigill_diag,
/*IN*/ VexArch arch_guest,
/* Convert one MIPS insn to IR. See the type DisOneInstrFn in bb_to_IR.h. */
extern DisResult disInstr_MIPS ( IRSB* irbb,
- Bool (*resteerOkFn) (void *, Addr64),
+ Bool (*resteerOkFn) (void *, Addr),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
/*--- Branch Instructions for mips64 ---*/
/*********************************************************/
static Bool dis_instr_branch ( UInt theInstr, DisResult * dres,
- Bool(*resteerOkFn) (void *, Addr64),
+ Bool(*resteerOkFn) (void *, Addr),
void *callback_opaque, IRStmt ** set )
{
UInt jmpKind = 0;
here. */
static DisResult disInstr_MIPS_WRK ( Bool(*resteerOkFn) (/*opaque */void *,
- Addr64),
+ Addr),
Bool resteerCisOk,
void* callback_opaque,
Long delta64,
/* Disassemble a single instruction into IR. The instruction
is located in host memory at &guest_code[delta]. */
DisResult disInstr_MIPS( IRSB* irsb_IN,
- Bool (*resteerOkFn) ( void *, Addr64 ),
+ Bool (*resteerOkFn) ( void *, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
bb_to_IR.h. */
extern
DisResult disInstr_PPC ( IRSB* irbb,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
static Bool dis_branch ( UInt theInstr,
const VexAbiInfo* vbi,
/*OUT*/DisResult* dres,
- Bool (*resteerOkFn)(void*,Addr64),
+ Bool (*resteerOkFn)(void*,Addr),
void* callback_opaque )
{
UChar opc1 = ifieldOPC(theInstr);
static Bool dis_transactional_memory ( UInt theInstr, UInt nextInstr,
const VexAbiInfo* vbi,
/*OUT*/DisResult* dres,
- Bool (*resteerOkFn)(void*,Addr64),
+ Bool (*resteerOkFn)(void*,Addr),
void* callback_opaque )
{
UInt opc2 = IFIELD( theInstr, 1, 10 );
static
DisResult disInstr_PPC_WRK (
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
Long delta64,
is located in host memory at &guest_code[delta]. */
DisResult disInstr_PPC ( IRSB* irsb_IN,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
/* Convert one s390 insn to IR. See the type DisOneInstrFn in
bb_to_IR.h. */
DisResult disInstr_S390 ( IRSB* irbb,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
static DisResult *dis_res;
/* Resteer function and callback data */
-static Bool (*resteer_fn)(void *, Addr64);
+static Bool (*resteer_fn)(void *, Addr);
static void *resteer_data;
/* Whether to print diagnostics for illegal instructions. */
DisResult
disInstr_S390(IRSB *irsb_IN,
- Bool (*resteerOkFn)(void *, Addr64),
+ Bool (*resteerOkFn)(void *, Addr),
Bool resteerCisOk,
void *callback_opaque,
const UChar *guest_code,
bb_to_IR.h. */
extern
DisResult disInstr_X86 ( IRSB* irbb,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code,
static
DisResult disInstr_X86_WRK (
/*OUT*/Bool* expect_CAS,
- Bool (*resteerOkFn) ( /*opaque*/void*, Addr64 ),
+ Bool (*resteerOkFn) ( /*opaque*/void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
Long delta64,
assign(t1, binop(Iop_Sub32, getIReg(4,R_ESP), mkU32(4)));
putIReg(4, R_ESP, mkexpr(t1));
storeLE( mkexpr(t1), mkU32(guest_EIP_bbstart+delta));
- if (resteerOkFn( callback_opaque, (Addr64)(Addr32)d32 )) {
+ if (resteerOkFn( callback_opaque, (Addr32)d32 )) {
/* follow into the call target. */
dres.whatNext = Dis_ResteerU;
dres.continueAt = (Addr64)(Addr32)d32;
case 0xEB: /* Jb (jump, byte offset) */
d32 = (((Addr32)guest_EIP_bbstart)+delta+1) + getSDisp8(delta);
delta++;
- if (resteerOkFn( callback_opaque, (Addr64)(Addr32)d32) ) {
+ if (resteerOkFn( callback_opaque, (Addr32)d32) ) {
dres.whatNext = Dis_ResteerU;
dres.continueAt = (Addr64)(Addr32)d32;
} else {
vassert(sz == 4); /* JRS added 2004 July 11 */
d32 = (((Addr32)guest_EIP_bbstart)+delta+sz) + getSDisp(sz,delta);
delta += sz;
- if (resteerOkFn( callback_opaque, (Addr64)(Addr32)d32) ) {
+ if (resteerOkFn( callback_opaque, (Addr32)d32) ) {
dres.whatNext = Dis_ResteerU;
dres.continueAt = (Addr64)(Addr32)d32;
} else {
&& vex_control.guest_chase_cond
&& (Addr32)d32 != (Addr32)guest_EIP_bbstart
&& jmpDelta < 0
- && resteerOkFn( callback_opaque, (Addr64)(Addr32)d32) ) {
+ && resteerOkFn( callback_opaque, (Addr32)d32) ) {
/* Speculation: assume this backward branch is taken. So we
need to emit a side-exit to the insn following this one,
on the negation of the condition, and continue at the
&& (Addr32)d32 != (Addr32)guest_EIP_bbstart
&& jmpDelta >= 0
&& resteerOkFn( callback_opaque,
- (Addr64)(Addr32)(guest_EIP_bbstart+delta)) ) {
+ (Addr32)(guest_EIP_bbstart+delta)) ) {
/* Speculation: assume this forward branch is not taken. So
we need to emit a side-exit to d32 (the dest) and continue
disassembling at the insn immediately following this
&& vex_control.guest_chase_cond
&& (Addr32)d32 != (Addr32)guest_EIP_bbstart
&& jmpDelta < 0
- && resteerOkFn( callback_opaque, (Addr64)(Addr32)d32) ) {
+ && resteerOkFn( callback_opaque, (Addr32)d32) ) {
/* Speculation: assume this backward branch is taken. So
we need to emit a side-exit to the insn following this
one, on the negation of the condition, and continue at
&& (Addr32)d32 != (Addr32)guest_EIP_bbstart
&& jmpDelta >= 0
&& resteerOkFn( callback_opaque,
- (Addr64)(Addr32)(guest_EIP_bbstart+delta)) ) {
+ (Addr32)(guest_EIP_bbstart+delta)) ) {
/* Speculation: assume this forward branch is not taken.
So we need to emit a side-exit to d32 (the dest) and
continue disassembling at the insn immediately
is located in host memory at &guest_code[delta]. */
DisResult disInstr_X86 ( IRSB* irsb_IN,
- Bool (*resteerOkFn) ( void*, Addr64 ),
+ Bool (*resteerOkFn) ( void*, Addr ),
Bool resteerCisOk,
void* callback_opaque,
const UChar* guest_code_IN,
vassert(sizeof(void*) == 4 || sizeof(void*) == 8);
vassert(sizeof(void*) == sizeof(int*));
vassert(sizeof(void*) == sizeof(HWord));
+ vassert(sizeof(void*) == sizeof(Addr));
+ vassert(sizeof(unsigned long) == sizeof(SizeT));
vassert(VEX_HOST_WORDSIZE == sizeof(void*));
vassert(VEX_HOST_WORDSIZE == sizeof(HWord));
/* Is it OK to chase into this guest address? May not be
NULL. */
- Bool (*chase_into_ok) ( /*callback_opaque*/void*, Addr64 );
+ Bool (*chase_into_ok) ( /*callback_opaque*/void*, Addr );
/* OUT: which bits of guest code actually got translated */
VexGuestExtents* guest_extents;
typedef UInt Addr32;
typedef ULong Addr64;
+/* An address: 32-bit or 64-bit wide depending on host architecture */
+typedef unsigned long Addr;
+
+
/* Something which has the same size as void* on the host. That is,
it is 32 bits on a 32-bit host and 64 bits on a 64-bit host, and so
it can safely be coerced to and from a pointer type on the host