X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=arch%2Farch-ppc.h;h=0f043bce5348731a6c5ec3775ded5b027aa715c4;hp=751762750dd5081b5710466b0d4b3c9b6d60b353;hb=ddc0cc31a2b75b1c7dde870c8867af11fa44db92;hpb=4247d1a9a27b6a23092a2c75e94e0545ad6a3376 diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h index 75176275..0f043bce 100644 --- a/arch/arch-ppc.h +++ b/arch/arch-ppc.h @@ -1,5 +1,5 @@ #ifndef ARCH_PPC_H -#define ARCH_PPH_H +#define ARCH_PPC_H #include #include @@ -72,9 +72,9 @@ static inline unsigned long long get_cpu_clock(void) tbl = mfspr(SPRN_ATBL); tbu1 = mfspr(SPRN_ATBU); } else { - __asm__ __volatile__("mftbu %0" : "=r"(tbu0)); - __asm__ __volatile__("mftb %0" : "=r"(tbl) ); - __asm__ __volatile__("mftbu %0" : "=r"(tbu1)); + tbu0 = mfspr(SPRN_TBRU); + tbl = mfspr(SPRN_TBRL); + tbu1 = mfspr(SPRN_TBRU); } } while (tbu0 != tbu1); @@ -96,11 +96,11 @@ static void atb_clocktest(void) pid = fork(); if (!pid) atb_child(); - else { + else if (pid != -1) { int status; - wait(&status); - if (!WIFEXITED(status)) + pid = wait(&status); + if (pid == -1 || !WIFEXITED(status)) arch_flags &= ~ARCH_FLAG_1; else arch_flags |= ARCH_FLAG_1; @@ -112,12 +112,20 @@ extern int tsc_reliable; static inline int arch_init(char *envp[]) { +#if 0 tsc_reliable = 1; atb_clocktest(); +#endif return 0; } #define ARCH_HAVE_FFZ -#define ARCH_HAVE_CPU_CLOCK + +/* + * We don't have it on all platforms, lets comment this out until we + * can handle it more intelligently. + * + * #define ARCH_HAVE_CPU_CLOCK + */ #endif