|
From: <sv...@va...> - 2005-04-02 17:30:23
|
Author: tom
Date: 2005-04-02 18:30:19 +0100 (Sat, 02 Apr 2005)
New Revision: 3509
Modified:
trunk/cachegrind/amd64/cg_arch.c
trunk/cachegrind/x86/cg_arch.c
Log:
Get cache detection going again on x86.
Modified: trunk/cachegrind/amd64/cg_arch.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/cachegrind/amd64/cg_arch.c 2005-04-02 17:26:07 UTC (rev 3508)
+++ trunk/cachegrind/amd64/cg_arch.c 2005-04-02 17:30:19 UTC (rev 3509)
@@ -250,17 +250,16 @@
{
Int level, ret;
Char vendor_id[13];
- /* Trap for illegal instruction, in case it's a really old processor =
that
- * doesn't support CPUID. */
- if (VG_(has_cpuid)()) {
- VG_(cpuid)(0, &level, (int*)&vendor_id[0],=20
- (int*)&vendor_id[8], (int*)&vendor_id[4]); =
=20
- vendor_id[12] =3D '\0';
- } else {
+
+ if (!VG_(has_cpuid)()) {
VG_(message)(Vg_DebugMsg, "CPUID instruction not supported");
return -1;
}
=20
+ VG_(cpuid)(0, &level, (int*)&vendor_id[0],=20
+ (int*)&vendor_id[8], (int*)&vendor_id[4]); =20
+ vendor_id[12] =3D '\0';
+
if (0 =3D=3D level) {
VG_(message)(Vg_DebugMsg, "CPUID level is 0, early Pentium?\n");
return -1;
Modified: trunk/cachegrind/x86/cg_arch.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/cachegrind/x86/cg_arch.c 2005-04-02 17:26:07 UTC (rev 3508)
+++ trunk/cachegrind/x86/cg_arch.c 2005-04-02 17:30:19 UTC (rev 3509)
@@ -35,7 +35,6 @@
// Probably only works for Intel and AMD chips, and probably only for so=
me of
// them.=20
=20
-#if 0
static void micro_ops_warn(Int actual_size, Int used_size, Int line_size=
)
{
VG_(message)(Vg_DebugMsg,=20
@@ -245,25 +244,18 @@
=20
return 0;
}
-#endif
=20
static=20
Int get_caches_from_CPUID(cache_t* I1c, cache_t* D1c, cache_t* L2c)
{
- VG_(message)(Vg_DebugMsg, "Can't auto-detect CPUID yet, giving up");
- return -1;
-#if 0
Int level, ret;
Char vendor_id[13];
-// tl_assert(res =3D=3D 0);
-//
-// res =3D VG_(sigaction)( VKI_SIGILL, &sigill_new, &sigill_saved );
-// tl_assert(res =3D=3D 0);
=20
if (!VG_(has_cpuid)()) {
VG_(message)(Vg_DebugMsg, "CPUID instruction not supported");
return -1;
}
+
VG_(cpuid)(0, &level, (int*)&vendor_id[0],=20
(int*)&vendor_id[8], (int*)&vendor_id[4]); =20
vendor_id[12] =3D '\0';
@@ -305,7 +297,6 @@
L2c->size *=3D 1024;
=20
return ret;
-#endif
}
=20
=20
|