Re: 64 to 32 bit jr

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

 



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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux