diff -ru linux-2.2.19-clean/arch/ppc/kernel/setup.c linux-2.2.19/arch/ppc/kernel/setup.c --- linux-2.2.19-clean/arch/ppc/kernel/setup.c Sun Mar 25 11:31:49 2001 +++ linux-2.2.19/arch/ppc/kernel/setup.c Wed Aug 22 16:34:51 2001 @@ -103,6 +103,14 @@ unsigned long vgacon_remap_base; #endif +/* the PPC601 chip does not support timebase registers, + * so this is used to keep track of whether or not we + * support them + */ +#ifdef CONFIG_6xx +extern int have_timebase = 1; +#endif /* CONFIG_6xx */ + /* copy of the residual data */ #ifndef CONFIG_MBX unsigned char __res[sizeof(RESIDUAL)] __prepdata = {0,}; @@ -243,6 +251,7 @@ { case 1: len += sprintf(len+buffer, "601\n"); + have_timebase = 0; break; case 3: len += sprintf(len+buffer, "603\n"); diff -ru linux-2.2.19-clean/drivers/char/random.c linux-2.2.19/drivers/char/random.c --- linux-2.2.19-clean/drivers/char/random.c Sun Mar 25 11:31:25 2001 +++ linux-2.2.19/drivers/char/random.c Wed Aug 22 16:35:34 2001 @@ -699,6 +699,7 @@ * are used for a high-resolution timer. * */ + static void add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state, unsigned num) { @@ -715,6 +716,16 @@ :"=a" (time), "=d" (high)); num ^= high; } else { + time = jiffies; + } +#elif defined (CONFIG_6xx) + if (have_timebase) { + __u32 high; + __asm__ __volatile__("mftbu %0" : "=r" (high) : ); + __asm__ __volatile__("mftb %0" : "=r" (time) : ); + num ^= high; + } + else { time = jiffies; } #else diff -ru linux-2.2.19-clean/include/asm-ppc/processor.h linux-2.2.19/include/asm-ppc/processor.h --- linux-2.2.19-clean/include/asm-ppc/processor.h Sun Mar 25 11:31:08 2001 +++ linux-2.2.19/include/asm-ppc/processor.h Wed Aug 22 16:34:51 2001 @@ -216,6 +216,14 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp); void release_thread(struct task_struct *); +/* the PPC601 chip does not support timebase registers, + * so this is used to keep track of whether or not we + * support them + */ +#ifdef CONFIG_6xx +extern int have_timebase; +#endif /* CONFIG_6xx */ + /* * Create a new kernel thread. */