[haiku-development] Re: Haiku on PowerPC - try 2. SUCCESS - PATCH attached

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 23 Jul 2009 07:50:24 -0500

On Thu, 23 Jul 2009 10:22:50 +0200 CEST, "Axel Dörfler"
<axeld@xxxxxxxxxxxxxxxx> wrote:
> Alexander von Gluck <kallisti5@xxxxxxxxxxx> wrote:
>> man.. worst patch release ever..
>> here is final.. final.. final.
>> i forgot to take out the old isync();
> Can you try putting isync()/sync() out of the loop, and call both just 
> before that loop instead? I have the feeling this is a bit of overkill.
> In any case, I've applied it now, thanks!
> Bye,
>    Axel.

Hey, the changes look great.  I should of taken the time to look where
isync was defined, thanks for the good call on that one.  Sorry about the
patch quality, I promise it will be better next time.. I was just in a
hurry cause I finally got that damn boot loader going. :)

After I found where the code was locking up, I looked over how Apple did
the contexts in their XNU kernel...


        /* Set up segment registers as VM through space 0 */
        for (i=0; i<=15; i++) {
          mtsrin((KERNEL_SEG_REG0_VALUE | (i << 20)), i * 0x10000000);

The for loop looks similar right?  Not word for word, but it looks like our
contexts are laid out about the same.

I also found an awesome explanation of when to sync and when to isync with
mtsrin calls:


I am not exactly sure what our mtsrin counts as on that chart, but after
looking at lots and lots of ppc code it seems more sync's are better. For
example I saw this quite common:

sync(); isync();
mtsrin call
sync(); isync();

That may be just the code of someone who has no idea what their doing
though...  who knows.

Alexander von Gluck
PGP: F079C049
Google Voice: 832-592-7635

Other related posts: