|
From: <sv...@va...> - 2005-06-30 11:50:25
|
Author: sewardj
Date: 2005-06-30 12:50:11 +0100 (Thu, 30 Jun 2005)
New Revision: 4066
Log:
Track Vex API change in r1233 (VexSubArch -> VexArchInfo).
Modified:
trunk/coregrind/m_translate.c
Modified: trunk/coregrind/m_translate.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/m_translate.c 2005-06-30 04:41:56 UTC (rev 4065)
+++ trunk/coregrind/m_translate.c 2005-06-30 11:50:11 UTC (rev 4066)
@@ -33,6 +33,7 @@
#include "pub_core_debuginfo.h" // Needed for pub_core_aspacemgr :(
#include "pub_core_aspacemgr.h"
#include "pub_core_cpuid.h"
+#include "pub_core_machine.h" // For VG_(cache_line_size_ppc32)
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
@@ -49,12 +50,17 @@
/*--- Determining arch/subarch. ---*/
/*------------------------------------------------------------*/
=20
-// Returns the architecture and subarchitecture, or indicates
-// that this subarchitecture is unable to run Valgrind
-// Returns False to indicate we cannot proceed further.
-static Bool getArchAndSubArch( /*OUT*/VexArch* vex_arch,=20
- /*OUT*/VexSubArch* vex_subarch )
+// Returns the architecture and auxiliary information, or indicates
+// that this subarchitecture is unable to run Valgrind Returns False
+// to indicate we cannot proceed further.
+
+static Bool getArchAndArchInfo( /*OUT*/VexArch* vex_arch,=20
+ /*OUT*/VexArchInfo* vai )
{
+ // Whack default settings into vai, so that we only need to fill in
+ // any interesting bits.
+ LibVEX_default_VexArchInfo(vai);
+
#if defined(VGA_x86)
Bool have_sse0, have_sse1, have_sse2;
UInt eax, ebx, ecx, edx;
@@ -77,19 +83,19 @@
=20
if (have_sse2 && have_sse1 && have_sse0) {
*vex_arch =3D VexArchX86;
- *vex_subarch =3D VexSubArchX86_sse2;
+ vai->subarch =3D VexSubArchX86_sse2;
return True;
}
=20
if (have_sse1 && have_sse0) {
*vex_arch =3D VexArchX86;
- *vex_subarch =3D VexSubArchX86_sse1;
+ vai->subarch =3D VexSubArchX86_sse1;
return True;
}
=20
if (have_sse0) {
*vex_arch =3D VexArchX86;
- *vex_subarch =3D VexSubArchX86_sse0;
+ vai->subarch =3D VexSubArchX86_sse0;
return True;
}
=20
@@ -98,13 +104,14 @@
=20
#elif defined(VGA_amd64)
vg_assert(VG_(has_cpuid)());
- *vex_arch =3D VexArchAMD64;
- *vex_subarch =3D VexSubArch_NONE;
+ *vex_arch =3D VexArchAMD64;
+ vai->subarch =3D VexSubArch_NONE;
return True;
=20
#elif defined(VGA_ppc32)
*vex_arch =3D VexArchPPC32;
- *vex_subarch =3D VexSubArchPPC32_noAV;
+ vai->subarch =3D VexSubArchPPC32_noAV;
+ vai->ppc32_cache_line_szB =3D VG_(cache_line_size_ppc32);
return True;
=20
#else
@@ -434,16 +441,17 @@
Segment* seg;
VexGuestExtents vge;
=20
- /* Indicates what arch and subarch we are running on. */
- static VexArch vex_arch =3D VexArch_INVALID;
- static VexSubArch vex_subarch =3D VexSubArch_INVALID;
+ /* Indicates what arch we are running on, and other important info
+ (subarch variant, cache line size). */
+ static VexArchInfo vex_archinfo;
+ static VexArch vex_arch =3D VexArch_INVALID;
=20
/* Make sure Vex is initialised right. */
VexTranslateResult tres;
static Bool vex_init_done =3D False;
=20
if (!vex_init_done) {
- Bool ok =3D getArchAndSubArch( &vex_arch, &vex_subarch );
+ Bool ok =3D getArchAndArchInfo( &vex_arch, &vex_archinfo );
if (!ok) {
VG_(printf)("\n");
VG_(printf)("valgrind: fatal error: unsupported CPU.\n");
@@ -457,7 +465,7 @@
VG_(message)(Vg_DebugMsg,=20
"Host CPU: arch =3D %s, subarch =3D %s",
LibVEX_ppVexArch ( vex_arch ),
- LibVEX_ppVexSubArch( vex_subarch ) );
+ LibVEX_ppVexSubArch( vex_archinfo.subarch ) );
}
=20
LibVEX_Init ( &failure_exit, &log_bytes,=20
@@ -548,8 +556,8 @@
tl_assert2(VG_(tdict).tool_instrument,
"you forgot to set VgToolInterface function 'tool_instrume=
nt'");
tres =3D LibVEX_Translate (=20
- vex_arch, vex_subarch,
- vex_arch, vex_subarch,
+ vex_arch, &vex_archinfo,
+ vex_arch, &vex_archinfo,
(UChar*)ULong_to_Ptr(orig_addr),=20
(Addr64)orig_addr,=20
chase_into_ok,
|