|
From: <sv...@va...> - 2005-03-30 19:04:34
|
Author: sewardj
Date: 2005-03-30 20:04:29 +0100 (Wed, 30 Mar 2005)
New Revision: 3484
Modified:
trunk/coregrind/core.h
trunk/coregrind/vg_main.c
trunk/coregrind/vg_scheduler.c
trunk/coregrind/x86/dispatch.S
Log:
Completely get rid of VG_(instr_ptr_offset).
Modified: trunk/coregrind/core.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/core.h 2005-03-30 18:42:59 UTC (rev 3483)
+++ trunk/coregrind/core.h 2005-03-30 19:04:29 UTC (rev 3484)
@@ -994,9 +994,6 @@
/* Counts downwards in vg_run_innerloop. */
extern UInt VG_(dispatch_ctr);
=20
-/* 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 );
=20
@@ -1607,7 +1604,7 @@
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 );
=20
/* ---------------------------------------------------------------------
Exports of vg_helpers.S
Modified: trunk/coregrind/vg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_main.c 2005-03-30 18:42:59 UTC (rev 3483)
+++ trunk/coregrind/vg_main.c 2005-03-30 19:04:29 UTC (rev 3484)
@@ -148,9 +148,6 @@
Char** VG_(client_argv);
Char** VG_(client_envp);
=20
-// 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) =3D VexArch_INVALID;
VexSubArch VG_(vex_subarch) =3D VexSubArch_INVALID;
@@ -2685,9 +2682,6 @@
VG_TRACK( post_reg_write, Vg_CoreStartup, /*tid*/1, /*offset*/0,
sizeof(VexGuestArchState));
=20
- // Record the instr ptr offset, for use by asm code.
- VG_(instr_ptr_offset) =3D offsetof(VexGuestArchState, VGA_INSTR_PTR);
-
//--------------------------------------------------------------
// Initialise the pthread model
// p: ?
Modified: trunk/coregrind/vg_scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/vg_scheduler.c 2005-03-30 18:42:59 UTC (rev 3483)
+++ trunk/coregrind/vg_scheduler.c 2005-03-30 19:04:29 UTC (rev 3484)
@@ -453,8 +453,6 @@
{
volatile Bool jumped;
volatile ThreadState *tst =3D VG_(get_ThreadState)(tid);
- //volatile Addr EIP =3D tst->arch.m_eip;
- //volatile Addr nextEIP;
=20
volatile UInt trc =3D 0;
volatile Int dispatch_ctr_SAVED =3D VG_(dispatch_ctr);
@@ -495,10 +493,6 @@
vg_assert(sz_spill =3D=3D LibVEX_N_SPILL_BYTES);
vg_assert(a_vex + 2 * sz_vex =3D=3D a_spill);
=20
- vg_assert(VG_(instr_ptr_offset) >=3D 0);
- vg_assert(VG_(instr_ptr_offset) <=3D 10000); /* let's say */
- vg_assert(sizeof VG_(instr_ptr_offset) =3D=3D sizeof(HWord));
-
VGP_PUSHCC(VgpRun);
=20
/* there should be no undealt-with signals */
@@ -509,7 +503,8 @@
vg_assert(VG_(my_fault));
VG_(my_fault) =3D False;
=20
- SCHEDSETJMP(tid, jumped, trc =3D VG_(run_innerloop)( (void*)&tst->arc=
h.vex ));
+ SCHEDSETJMP(tid, jumped,=20
+ trc =3D (UInt)VG_(run_innerloop)( (void*)&tst->arch.=
vex ));
=20
//nextEIP =3D tst->arch.m_eip;
//if (nextEIP >=3D VG_(client_end))
Modified: trunk/coregrind/x86/dispatch.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/x86/dispatch.S 2005-03-30 18:42:59 UTC (rev 3483)
+++ trunk/coregrind/x86/dispatch.S 2005-03-30 19:04:29 UTC (rev 3484)
@@ -31,14 +31,15 @@
=20
#include "core_asm.h"
#include "x86_private_asm.h"
+#include "libvex_guest_offsets.h" /* for OFFSET_x86_EIP */
=20
=20
/*------------------------------------------------------------*/
/*--- The dispatch loop. ---*/
/*------------------------------------------------------------*/
-=09
-/* signature: UInt VG_(run_innerloop) ( void* guest_state ) */
=20
+/* signature: UWord VG_(run_innerloop) ( void* guest_state ) */
+
.globl VG_(run_innerloop)
VG_(run_innerloop):
/* 4(%esp) holds guest_state */
@@ -57,8 +58,7 @@
movl 28(%esp), %ebp
=09
/* fetch %EIP into %eax */
- movl VG_(instr_ptr_offset), %esi
- movl (%ebp, %esi, 1), %eax
+ movl OFFSET_x86_EIP(%ebp), %eax
=20
/* set host FPU control word to the default mode expected=20
by VEX-generated code. See comments in libvex.h for
@@ -84,8 +84,7 @@
=20
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)
=20
/* Are we out of timeslice? If yes, defer to scheduler. */
subl $1, VG_(dispatch_ctr)
@@ -169,9 +168,8 @@
jz counter_is_zero
=20
/* 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
=20
|