From mboxrd@z Thu Jan 1 00:00:00 1970 From: YanMin Qiao Date: Sat, 04 Jan 2003 22:35:57 +0800 Subject: [U-Boot-Users] another question of relocate_code References: <20030104135753.B8E0EC608E@atlas.denx.de> Message-ID: <3E16F14D.8030808@sjtu.edu.cn> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: >In message <3E16E5AE.4090002@sjtu.edu.cn> you wrote: > > >>Hi all: >> >>/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