Subject: Re: netbsd-current and ibook g4: kernel freeze
To: leon zadorin <leonleon77@gmail.com>
From: Allen Briggs <briggs@netbsd.org>
List: port-macppc
Date: 02/01/2007 21:40:23
On Fri, Feb 02, 2007 at 10:22:02AM +1000, leon zadorin wrote:
> But then (given that "FIRMWORKSBUGS" does not appear to be defined
> during my build), is the code:
> 
> 	lis	8,openfirmware_entry@ha
> 	stw	5,openfirmware_entry@l(8) /* save client interface handler*/
> 
> the one which defines the "openfirmware_entry" (if so how does it

Yes.  When OFW transfers control to the kernel, r5 contains the
address of the OpenFirmware entry point.  This is a way for us to
call back into the OpenFirmware environment, defined by the
OpenFirmware specifications.  As for the mechanism...

 	lis	8,openfirmware_entry@ha

Loads the upper 16 bits of r8 with the upper 16 bits of the address
of our variable 'openfirmware_entry' (load immediate data with a shift,
and the @ha says to the assembler/linker to take the upper 16 bits of
the symbol's address, suitable for signed arithmetic with the lower half
to get the actual address).

 	stw	5,openfirmware_entry@l(8) /* save client interface handler*/

Stores r5 into the address formed by adding the contents of r8 to the
lower 16 bits of the address of our 'openfirmware_entry' variable.

Make sense?

-allen

-- 
Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com