Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patch for sys/arch/powerpc/oea/ofwoea_machdep.c



[cc'ed port-powerpc instead of current-users]

wgalazka.dev%gmail.com@localhost wrote:

> Please consider this patch.
> Without this patch kernel panics on a PowerMac machine with PPC_601
> cpu. installed. This is because real time clock is handled using
> different opcodes on PPC_601 than on other 32 bit PPC_60x processors.
> 
> --- sys/arch/powerpc/oea/org/ofwoea_machdep.c 2008-12-01 04:09:42 +0000
> +++ sys/arch/powerpc/oea/ofwoea_machdep.c     2008-03-17 08:26:52 +0000
> @@ -1,4 +1,4 @@
> -/* $NetBSD: ofwoea_machdep.c,v 1.16 2008/11/30 18:21:35 martin Exp $ */
> +/* $NetBSD: ofwoea_machdep.c,v 1.16 2009/01/15 18:21:35 martin Exp $ */
> 
>  /*-
>   * Copyright (c) 2007 The NetBSD Foundation, Inc.
> @@ -280,7 +280,12 @@
>       ns_per_tick = 1000000000 / ticks_per_sec;
>       ticks_per_intr = ticks_per_sec / hz;
>       cpu_timebase = ticks_per_sec;
> -     curcpu()->ci_lasttb = mftbl();
> +#if defined PPC_OEA601
> +     if ((mfpvr() >> 16) == MPC601)
> +             curcpu()->ci_lasttb  = mfrtcl();
> +     else
> +#endif
> +             curcpu()->ci_lasttb  = mftbl();
>       mtspr(SPR_DEC, ticks_per_intr);
>       mtmsr(msr);
>  }

powerpc/oea/pmap.c:mfrtcltbl() uses "mfrtcl() >> 7" for MPC601
rather than mfrtcl() itself.

Which is better for ci_lasttb?
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index