[Top] [All Lists]

Re: 64 to 32 bit jr

To: "" <>
Subject: Re: 64 to 32 bit jr
From: "Erik J. Green" <>
Date: Mon, 7 Apr 2003 17:18:05 +0000
In-reply-to: <>
Original-recipient: rfc822;
References: <>
User-agent: Internet Messaging Program (IMP) 4.0-cvs
Quoting "Maciej W. Rozycki" <>:

> > 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

0xa800000000000000 + 0x20004000

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


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

>  HTH,
>   Maciej

It does, thanks.

Erik J. Green

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