#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__
#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)
+ : "cr0");
+
+ return rval;
+}
+#else
static inline unsigned long long get_cpu_clock(void)
{
unsigned int tbl, tbu0, tbu1;
ret = (((unsigned long long)tbu0) << 32) | tbl;
return ret;
}
+#endif
#if 0
static void atb_child(void)
#endif
#define ARCH_HAVE_INIT
-extern int tsc_reliable;
+extern bool tsc_reliable;
static inline int arch_init(char *envp[])
{
#if 0
- tsc_reliable = 1;
+ tsc_reliable = true;
atb_clocktest();
#endif
return 0;
* #define ARCH_HAVE_CPU_CLOCK
*/
+/*
+ * Let's have it defined for ppc64
+ */
+
+#ifdef __powerpc64__
+#define ARCH_HAVE_CPU_CLOCK
+#endif
+
#endif