[Cbe-oss-dev] [PATCH] libspe2: setup intial registers with trampoline, rather than the regs file

Kazunori Asayama asayama at sm.sony.co.jp
Wed Aug 13 17:35:06 EST 2008


Jeremy Kerr wrote:
> Update: stack pointer is r1, not r0.

I don't think the problem is fixed.

(snip)

> +static uint32_t reg_setup_trampoline[] = {
> +/* reg_state: */
> +	[sizeof(struct spe_reg_state) / sizeof(uint32_t)] =
> +/* _start: */
> +	0x33fff603, /* lqr     r3,0 <reg_state>       */
> +	0x33fff784, /* lqr     r4,10 <reg_state+0x10> */
> +	0x33fff905, /* lqr     r5,20 <reg_state+0x20> */
> +	0x00200000, /* lnop                           */
> +	0x33fffa06, /* lqr     r6,30 <reg_state+0x30> */
> +	0x33fffb81, /* lqr     r1,40 <reg_state+0x40> */
> +	0x40800002, /* il      r2,0                   */
> +	0x35200081, /* bisl    r1,r1                  */


The content of reg_state + 0x40 is not the initial stack pointer, but 
the entry point.

I think you need to add a new member 'sp' to spe_reg_state structure, 
set appropriate value to the member in _base_spe_context_run() and add a 
new instruction to the trampoline to load that value into $sp.

-- 
(ASAYAMA Kazunori
   (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list