/* Counts downwards in vg_run_innerloop. */
extern UInt VG_(dispatch_ctr);
-/* Instruction pointer guest state offset, used by $VG_ARCH/dispatch.S. */
-extern OffT VG_(instr_ptr_offset);
-
/* Stats ... */
extern void VG_(print_scheduler_stats) ( void );
address is found in the translation cache. For anything else, the
scheduler does the work.
*/
-extern UInt VG_(run_innerloop) ( void* guest_state );
+extern UWord VG_(run_innerloop) ( void* guest_state );
/* ---------------------------------------------------------------------
Exports of vg_helpers.S
Char** VG_(client_argv);
Char** VG_(client_envp);
-// Instruction pointer guest state offset, used by $VG_ARCH/dispatch.S.
-OffT VG_(instr_ptr_offset);
-
/* Indicates what arch and subarch we are running on. */
VexArch VG_(vex_arch) = VexArch_INVALID;
VexSubArch VG_(vex_subarch) = VexSubArch_INVALID;
VG_TRACK( post_reg_write, Vg_CoreStartup, /*tid*/1, /*offset*/0,
sizeof(VexGuestArchState));
- // Record the instr ptr offset, for use by asm code.
- VG_(instr_ptr_offset) = offsetof(VexGuestArchState, VGA_INSTR_PTR);
-
//--------------------------------------------------------------
// Initialise the pthread model
// p: ?
{
volatile Bool jumped;
volatile ThreadState *tst = VG_(get_ThreadState)(tid);
- //volatile Addr EIP = tst->arch.m_eip;
- //volatile Addr nextEIP;
volatile UInt trc = 0;
volatile Int dispatch_ctr_SAVED = VG_(dispatch_ctr);
vg_assert(sz_spill == LibVEX_N_SPILL_BYTES);
vg_assert(a_vex + 2 * sz_vex == a_spill);
- vg_assert(VG_(instr_ptr_offset) >= 0);
- vg_assert(VG_(instr_ptr_offset) <= 10000); /* let's say */
- vg_assert(sizeof VG_(instr_ptr_offset) == sizeof(HWord));
-
VGP_PUSHCC(VgpRun);
/* there should be no undealt-with signals */
vg_assert(VG_(my_fault));
VG_(my_fault) = False;
- SCHEDSETJMP(tid, jumped, trc = VG_(run_innerloop)( (void*)&tst->arch.vex ));
+ SCHEDSETJMP(tid, jumped,
+ trc = (UInt)VG_(run_innerloop)( (void*)&tst->arch.vex ));
//nextEIP = tst->arch.m_eip;
//if (nextEIP >= VG_(client_end))
#include "core_asm.h"
#include "x86_private_asm.h"
+#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
/*------------------------------------------------------------*/
/*--- The dispatch loop. ---*/
/*------------------------------------------------------------*/
-
-/* signature: UInt VG_(run_innerloop) ( void* guest_state ) */
+
+/* signature: UWord VG_(run_innerloop) ( void* guest_state ) */
.globl VG_(run_innerloop)
VG_(run_innerloop):
movl 28(%esp), %ebp
/* fetch %EIP into %eax */
- movl VG_(instr_ptr_offset), %esi
- movl (%ebp, %esi, 1), %eax
+ movl OFFSET_x86_EIP(%ebp), %eax
/* set host FPU control word to the default mode expected
by VEX-generated code. See comments in libvex.h for
dispatch_boring:
/* save the jump address in the guest state */
- movl VG_(instr_ptr_offset), %esi
- movl %eax, (%ebp, %esi, 1)
+ movl %eax, OFFSET_x86_EIP(%ebp)
/* Are we out of timeslice? If yes, defer to scheduler. */
subl $1, VG_(dispatch_ctr)
jz counter_is_zero
/* save %eax in %EIP and defer to sched */
- movl VG_(instr_ptr_offset), %esi
movl 28(%esp), %edi
- movl %eax, (%edi, %esi, 1)
+ movl %eax, OFFSET_x86_EIP(%edi)
movl %ebp, %eax
jmp run_innerloop_exit