+ return rval;
+}
+#else
+static inline unsigned long long get_cpu_clock(void)
+{
+ unsigned int tbl, tbu0, tbu1;
+ unsigned long long ret;
+
+ do {
+ if (arch_flags & ARCH_FLAG_1) {
+ tbu0 = mfspr(SPRN_ATBU);
+ tbl = mfspr(SPRN_ATBL);
+ tbu1 = mfspr(SPRN_ATBU);
+ } else {
+ tbu0 = mfspr(SPRN_TBRU);
+ tbl = mfspr(SPRN_TBRL);
+ tbu1 = mfspr(SPRN_TBRU);
+ }
+ } while (tbu0 != tbu1);
+
+ ret = (((unsigned long long)tbu0) << 32) | tbl;
+ return ret;
+}
+#endif
+
+#if 0
+static void atb_child(void)
+{
+ arch_flags |= ARCH_FLAG_1;
+ get_cpu_clock();
+ _exit(0);
+}
+
+static void atb_clocktest(void)
+{
+ pid_t pid;
+
+ pid = fork();
+ if (!pid)
+ atb_child();
+ else if (pid != -1) {
+ int status;
+
+ pid = wait(&status);
+ if (pid == -1 || !WIFEXITED(status))
+ arch_flags &= ~ARCH_FLAG_1;
+ else
+ arch_flags |= ARCH_FLAG_1;
+ }
+}
+#endif
+
+#define ARCH_HAVE_INIT
+extern int tsc_reliable;
+
+static inline int arch_init(char *envp[])
+{
+#if 0
+ tsc_reliable = 1;
+ atb_clocktest();
+#endif
+ return 0;