All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] another question of relocate_code
@ 2003-01-04 13:46 YanMin Qiao
  2003-01-04 13:57 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: YanMin Qiao @ 2003-01-04 13:46 UTC (permalink / raw)
  To: u-boot

Hi all:

<u-boot>/cpu/mpc8xx/start.S

....
relocate_code:
    mr    r1,  r3        /* Set new stack pointer        */
    mr    r9,  r4        /* Save copy of Global Data pointer    */
    mr    r10, r5        /* Save copy of Destination Address    */
....
    sub    r15, r10, r4

    /* First our own GOT */
    add    r14, r14, r15
    /* the the one used by the C code */
    add    r30, r30, r15
              ^^^
....

I have followed the code to the end of board_init_r().  I didn't figured 
out where r30 is used
as mentioned.

Thanks

Best regards

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] another question of relocate_code
  2003-01-04 13:46 [U-Boot-Users] another question of relocate_code YanMin Qiao
@ 2003-01-04 13:57 ` Wolfgang Denk
  2003-01-04 14:35   ` YanMin Qiao
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2003-01-04 13:57 UTC (permalink / raw)
  To: u-boot

In message <3E16E5AE.4090002@sjtu.edu.cn> you wrote:
> Hi all:
> 
> <u-boot>/cpu/mpc8xx/start.S
> 
> ....
> relocate_code:
>     mr    r1,  r3        /* Set new stack pointer        */
>     mr    r9,  r4        /* Save copy of Global Data pointer    */
>     mr    r10, r5        /* Save copy of Destination Address    */
> ....
>     sub    r15, r10, r4
> 
>     /* First our own GOT */
>     add    r14, r14, r15
>     /* the the one used by the C code */
>     add    r30, r30, r15
>               ^^^
> ....
> 
> I have followed the code to the end of board_init_r().  I didn't figured 
> out where r30 is used
> as mentioned.

Which part of this section from the README didn't you understand?

	... we are restricted  by  the 
	relevant  (E)ABI  specifications for the current architecture, and by
	GCC's implementation.
	   
	For PowerPC, the following registers have specific use:
		R1:     stack pointer 
		R2:     TOC pointer 
		R3-R4:  parameter passing and return values
		R5-R10: parameter passing 
		R13:    small data area pointer 
		R30:    GOT pointer 
		R31:    frame pointer 
	   
		(U-Boot also uses R14 as internal GOT pointer.)

If you want to know all the ugly details  I  recommend  to  read  the
(E)ABI specifications and the relevant parts of the GCC source code.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Real computer scientists despise the idea of actual  hardware.  Hard-
ware has limitations, software doesn't. It's a real shame that Turing
machines are so poor at I/O.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot-Users] another question of relocate_code
  2003-01-04 13:57 ` Wolfgang Denk
@ 2003-01-04 14:35   ` YanMin Qiao
  0 siblings, 0 replies; 3+ messages in thread
From: YanMin Qiao @ 2003-01-04 14:35 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:

>In message <3E16E5AE.4090002@sjtu.edu.cn> you wrote:
>  
>
>>Hi all:
>>
>><u-boot>/cpu/mpc8xx/start.S
>>
>>....
>>relocate_code:
>>    mr    r1,  r3        /* Set new stack pointer        */
>>    mr    r9,  r4        /* Save copy of Global Data pointer    */
>>    mr    r10, r5        /* Save copy of Destination Address    */
>>....
>>    sub    r15, r10, r4
>>
>>    /* First our own GOT */
>>    add    r14, r14, r15
>>    /* the the one used by the C code */
>>    add    r30, r30, r15
>>              ^^^
>>....
>>
>>I have followed the code to the end of board_init_r().  I didn't figured 
>>out where r30 is used
>>as mentioned.
>>    
>>
>
>Which part of this section from the README didn't you understand?
>
>	... we are restricted  by  the 
>	relevant  (E)ABI  specifications for the current architecture, and by
>	GCC's implementation.
>	   
>	For PowerPC, the following registers have specific use:
>		R1:     stack pointer 
>		R2:     TOC pointer 
>		R3-R4:  parameter passing and return values
>		R5-R10: parameter passing 
>		R13:    small data area pointer 
>		R30:    GOT pointer 
>		R31:    frame pointer 
>	   
>		(U-Boot also uses R14 as internal GOT pointer.)
>
>If you want to know all the ugly details  I  recommend  to  read  the
>(E)ABI specifications and the relevant parts of the GCC source code.
>
>Best regards,
>
>Wolfgang Denk
>
>  
>
thanks for the mention of eabi  :)

Best regards

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-04 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-04 13:46 [U-Boot-Users] another question of relocate_code YanMin Qiao
2003-01-04 13:57 ` Wolfgang Denk
2003-01-04 14:35   ` YanMin Qiao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.