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

Re: TEST: Sleep suppport for iBook G4 & Aluminium PowerBooks (ATI based)

On Fri, 2004-11-19 at 09:13 +0100, Colin Leroy wrote:
> On 19 Nov 2004 at 17h11, Benjamin Herrenschmidt wrote:
> Hi, 
> > http://gate.crashing.org/~benh/albook-ibookg4-sleep.diff
> gcc spits a warning on arch/ppc/syslib/prom_init.c:708, where we have
>         /* copy the holding pattern code to someplace safe (0) */
>         /* the holding pattern is now within the first 0x100
>            bytes of the kernel image -- paulus */
>         memcpy((void *)0, _stext, 0x100);
>         flush_icache_range(0, 0x100);
> The comment looks like it is intentional, but that looks very strange
> to me... How isn't it a problem ? (just for my personal curiosity :))

What is the actual warning ?

This code is run within the OF environment where memory is mapped 1:1,
and whith the kernel still located at a different place than it's native
address (0). This code copies the first 0x100 bytes of kernel code down
to that location (which doesn't contain anything useful, the first
exception vector is at 0x100). This piece of code contains a special
loop used for holding other CPUs until the kernel actually puts them
online. It's only used on CHRP machines, PowerMacs use a different
mecanism to get the CPUs online.


Reply to: