X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=arch%2Farch-ppc.h;h=4a8aa97c4d9dbc01bd427e6c49e10fefbe5c41ac;hb=62720129955be364c937534fe98024403ce5ba19;hp=aed41f9bad6d53d6ee06978f95e8e1d131ce4a8a;hpb=0ff8ad2e50052293c74254bb52c95de8ab2b1d90;p=fio.git diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h index aed41f9b..4a8aa97c 100644 --- a/arch/arch-ppc.h +++ b/arch/arch-ppc.h @@ -8,21 +8,6 @@ #define FIO_ARCH (arch_ppc) -#ifndef __NR_ioprio_set -#define __NR_ioprio_set 273 -#define __NR_ioprio_get 274 -#endif - -#ifndef __NR_fadvise64 -#define __NR_fadvise64 233 -#endif - -#ifndef __NR_sys_splice -#define __NR_sys_splice 283 -#define __NR_sys_tee 284 -#define __NR_sys_vmsplice 285 -#endif - #define nop do { } while (0) #ifdef __powerpc64__ @@ -67,6 +52,21 @@ static inline unsigned int mfspr(unsigned int reg) #define SPRN_ATBL 0x20E /* Alternate Time Base Lower */ #define SPRN_ATBU 0x20F /* Alternate Time Base Upper */ +#ifdef __powerpc64__ +static inline unsigned long long get_cpu_clock(void) +{ + unsigned long long rval; + + asm volatile( + "90: mfspr %0, %1;\n" + " cmpwi %0,0;\n" + " beq- 90b;\n" + : "=r" (rval) + : "i" (SPRN_TBRL)); + + return rval; +} +#else static inline unsigned long long get_cpu_clock(void) { unsigned int tbl, tbu0, tbu1; @@ -87,6 +87,7 @@ static inline unsigned long long get_cpu_clock(void) ret = (((unsigned long long)tbu0) << 32) | tbl; return ret; } +#endif #if 0 static void atb_child(void) @@ -136,4 +137,12 @@ static inline int arch_init(char *envp[]) * #define ARCH_HAVE_CPU_CLOCK */ +/* + * Let's have it defined for ppc64 + */ + +#ifdef __powerpc64__ +#define ARCH_HAVE_CPU_CLOCK +#endif + #endif