I think all XScale processors have CP14 timestamp (see <http://download.intel.com/design/intelxscale/XScaleDatasheet4.pdf>) but it's in register 1, not register 0. The original report is right in that StrongArm processors do not have a CP14. Therefore the following *should* work:
--- liboil-0.3.10.orig/liboil/liboilcpu.c 2006-11-06 01:37:03.000000000 +0000 +++ liboil-0.3.10/liboil/liboilcpu.c 2007-02-22 13:41:31.000000000 +0000 @@ -620,7 +620,7 @@ { unsigned int ts; __asm__ __volatile__ ( - " mrc p14, 0, %0, c0, c0, 0 \n" + " mrc p14, 0, %0, c1, c0, 0 \n" : "=r" (ts)); return ts; } @@ -629,7 +629,8 @@ oil_cpu_detect_arm(void) { #ifdef __linux__ - int arm_implementer; + int arm_implementer = 0; + char arm_architecture = 0; char *cpuinfo; char *s; @@ -640,18 +641,16 @@ arm_implementer = strtoul (s, NULL, 0); free(s); } + s = get_cpuinfo_line(cpuinfo, "CPU architecture"); + if (s) { + char *p = s + strspn(s, " \t"); + arm_architecture = *p; + free(s); + } - switch(arm_implementer) { - case 0x69: /* Intel */ - /* assume that all Intel chips support CP14 timestamp */ - _oil_profile_stamp = oil_profile_stamp_xscale; - break; - case 0x41: /* ARM */ - /* ARM chips are known to not have timestamping available from - * user space */ - break; - default: - break; + /* only Intel XScale processors support CP14 timestamp */ + if (arm_implementer == 0x69 && arm_architecture == '5') { + _oil_profile_stamp = oil_profile_stamp_xscale; } free (cpuinfo); -- END -- In practice it still results in SIGILL, so I agree we should never use oil_profile_stamp_xscale(). Ben. -- Ben Hutchings Beware of bugs in the above code; I have only proved it correct, not tried it. - Donald Knuth
signature.asc
Description: This is a digitally signed message part