On Wed, Apr 16, 2014 at 2:01 PM, Stefan Wallentowitz
<[email protected]> wrote:
> On 04/16/2014 12:43 PM, Stefan Kristiansson wrote:
>>
>> Since this is Non-Linux specific, could you use r10 that is pinned
>> down as the thread_info pointer in Linux.
>> (we should really document this as our ABI and call it something in
>> line with "reserverd for kernel/OS use").
>>
>> Stefan
> Unfortunately not:
>
> 1. I need to calculate pointers to the exception stack. In the following
> example exception stack is an array of pointers (but calculating the
> actual position also requires more than one register for
> shifting/multiplying and subtracting):
>
> l.movhi rx,hi(exception_stack)
> l.ori rx,rx,lo(exception_stack)
> l.mfspr ry,r0,SPR_COREID
> l.slli ry,ry,2
> l.add rx,rx,rx
> l.lwz ry,0(rx)
> l.sw 0(ry),r1
> l.or r1, r0, ry
>

Can't you use per-cpu register save-slots in shared memory?
I.e. reusing the 'hack' in Linux that uses 0x0-0x100 as a scratchpad:

l.mfspr ry,r0,SPR_COREID
l.slli ry,ry,2
l.sw 0(ry),rx
l.movhi rx,hi(exception_stack)
l.ori rx,rx,lo(exception_stack)
l.add rx,rx,ry
l.lwz ry,0(rx)
l.sw 0(ry),r1
l.or r1, r0, ry
...
l.mfspr ry,r0,SPR_COREID
l.slli ry,ry,2
l.lwz rx,0(ry)
l.rfe

I'm personally not very fond of the other alternatives, that's why I'm
being difficult here.
In my opinion it would even be more preferable to reserve another GPR
for kernel/OS use than the other alternatives.

Stefan
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to