linux-mips
[Top] [All Lists]

Re: 64 to 32 bit jr

To: "linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: 64 to 32 bit jr
From: "Erik J. Green" <erik@greendragon.org>
Date: Mon, 7 Apr 2003 17:18:05 +0000
In-reply-to: <Pine.GSO.3.96.1030407174523.24634D-100000@delta.ds2.pg.gda.pl>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.GSO.3.96.1030407174523.24634D-100000@delta.ds2.pg.gda.pl>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Internet Messaging Program (IMP) 4.0-cvs
Quoting "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>:

[deletions]
> > physical memory starting at address 0.  Head.S then jumps to the 32-bit
> part of
> > the xkphys address, which happens to be arranged so that it matches the
> correct
> > (next instruction) address in kseg0.
> 
>  Just see how these virtual addresses map to physical ones.

According to my current understanding, the base of each of 8 segments in xkphys
maps to the start of physical memory, so offset 0 in kseg0 should be the same
data as at offset 0 of the a800...0000 segment in xkphys.  So, if I load code
starting at offset 0 in xkphys, I should be able to jump to the 32-bit part of
the xkphys address and end up at the same offset in kseg0, provided the target
address is sign-extended properly.

The actual difficulty I'm having is that the address my code is loading at is
computed at link time by adding the xkphys base to the LOADADDRESS value using
mips64-linux-objcopy.  I haven't quite worked out the address math yet to  make
the code in xkphys and kseg0 have the same offsets.  Objcopy seems to have some
non-obvious rules for doing address calculations, IE objcopy using
--change-addresses=X

0xa800000000000000 + 0x20004000

gives something close to (not near my MIPS system atm)

0xa7ffffff2001c000

So, I'm thinking constructing the address in a register might be easier for now.

> 
>  HTH,
> 
>   Maciej


It does, thanks.

Erik
-- 
Erik J. Green
erik@greendragon.org

<Prev in Thread] Current Thread [Next in Thread>